Skip to content

Instantly share code, notes, and snippets.

@SammyVimes
Created February 27, 2015 13:11
Show Gist options
  • Save SammyVimes/a7477264cde2ff5f9114 to your computer and use it in GitHub Desktop.
Save SammyVimes/a7477264cde2ff5f9114 to your computer and use it in GitHub Desktop.
123
public static MyCardFragment create(CharSequence title, CharSequence text, int iconRes) {
MyCardFragment fragment = new MyCardFragment();
Bundle args = new Bundle();
if (title != null) args.putCharSequence("CardFragment_title", title);
if (text != null) args.putCharSequence("CardFragment_text", text);
if (iconRes != 0) args.putInt("CardFragment_icon", iconRes);
fragment.setArguments(args);
return fragment;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment