Code example for ListFragment

Methods: onAttach

0
		setListAdapter(adapter);
	} 
	 
	@Override 
	public void onAttach(Activity activity) {
		super.onAttach(activity);
		 
		try { 
			mContactsListener = (OnContactSelectedListener) activity;
		} catch (ClassCastException	e) {
			throw new ClassCastException(activity.toString() + " must implement OnContactSelectedListener");
		} 
	} 
	 
	@Override 
	public void onDestroyView() { 
		super.onDestroyView(); 
		mCursor.close();
	} 
	 
	@Override