Skip to content

Instantly share code, notes, and snippets.

@SammyVimes
Created February 27, 2015 11:02
Show Gist options
  • Save SammyVimes/46b0c181ff97ac981b2b to your computer and use it in GitHub Desktop.
Save SammyVimes/46b0c181ff97ac981b2b to your computer and use it in GitHub Desktop.
Deriving from CardFragment
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