Code example for ListFragment

Methods: getLoaderManager, onAttach

0
		setEmptyText(getActivity().getString(R.string.list_searching_documents));
	} 
 
	@Override 
	public void onAttach(Activity activity) {
		super.onAttach(activity);
 
		if (!(activity instanceof MainActivity))
			throw new IllegalArgumentException(
					"Activity must be of type MainActivity"); 
 
		getLoaderManager().restartLoader(0, null, this);
	} 
 
	@Override 
	public void onListItemClick(ListView l, View v, int position, long id) {
		super.onListItemClick(l, v, position, id);
 
		if (items == null)
			return;