Java tutorial
//package com.java2s; import android.os.Bundle; import android.support.v4.app.Fragment; public class Main { public static void putString(Fragment fragment, String key, String value) { Bundle args = getArguments(fragment); args.putString(key, value); fragment.setArguments(args); } private static Bundle getArguments(Fragment fragment) { return (fragment.getArguments() == null) ? new Bundle() : fragment.getArguments(); } }