Code example for Fragment

Methods: getArgumentsonCreatesetRetainInstance

1
	private OpenRocketSaverTask task;
	private OnOpenRocketFileSaved listener;
	 
	@Override 
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setRetainInstance(true);
		Bundle b = getArguments();
		if ( b != null ) {
			showProgressDialog = b.getBoolean(SHOW_PRGRESS_DIALOG_ARG, true);
		} 
		if ( task == null ) {
			// since we retain instance state, task will be non-null if it is already loading. 
			task = new OpenRocketSaverTask();
			task.execute();
		} 
	} 
 
	@Override 
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
Contextual code suggestions in your IDE  Get Codota for Java