Skip to content

Instantly share code, notes, and snippets.

@orhanobut
Created September 23, 2015 07:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save orhanobut/df46fae72878be2bd81e to your computer and use it in GitHub Desktop.
Save orhanobut/df46fae72878be2bd81e to your computer and use it in GitHub Desktop.
public class MyFragment extends Fragment {
private static final String KEY_NAME = "KEY_NAME";
public static Fragment newFragment(String name) {
Fragment fragment = new MyFragment();
Bundle bundle = new Bundle();
bundle.putExtra(KEY_NAME, name);
fragment.setArguments(bundle);
return fragment;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment