Code example for Bundle

Methods: putIntputSerializableputString

0
    private StoryOrder storyOrder;
 
	public static FeedItemListFragment newInstance(String feedId, int currentState, StoryOrder storyOrder) {
		FeedItemListFragment feedItemFragment = new FeedItemListFragment();
 
		Bundle args = new Bundle();
		args.putInt("currentState", currentState);
		args.putString("feedId", feedId);
		args.putSerializable("storyOrder", storyOrder);
		feedItemFragment.setArguments(args);
 
		return feedItemFragment;
	} 
 
	@Override 
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		currentState = getArguments().getInt("currentState");
		feedId = getArguments().getString("feedId");
		storyOrder = (StoryOrder)getArguments().getSerializable("storyOrder");
	}