Code example for Fragment

Methods: onSaveInstanceState

	public void onSaveInstanceState(Bundle outState) {
		outState.putSerializable("constraint", constraint);
		outState.putInt("index", index);
		outState.putBoolean("dirty", dirty);
	public void onCreate(Bundle savedInstanceState) {
		// If we get created for the first time we get our data from the intent 
		Bundle data = savedInstanceState != null ? savedInstanceState : getArguments();
		constraint = (Constraint) data.get("constraint");
		index = data.getInt("index");
		dirty = data.getBoolean("dirty", false);
	public void onActivityCreated(Bundle savedInstanceState) {
Stop searching for code, let great code find you!  Add Codota to your java IDE