Code example for Fragment

Methods: getLoaderManager, onActivityCreated

0
		return view;
	} 
 
	@Override 
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);
 
		Bundle loaderArgs = new Bundle();
		loaderArgs.putInt("episodeId", episodeId);
		getLoaderManager().initLoader(0, loaderArgs, this);
	} 
 
	@Override 
	public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
		inflater.inflate(R.menu.episode_details_fragment, menu);
 
		watchedCheckBox =
			(CheckBox)MenuItemCompat.getActionView(menu.findItem(R.id.menu_watched));
 
		final ContentResolver contentResolver =
			getActivity().getContentResolver();