Code example for ListFragment

Methods: onAttach

0
        return inflater.inflate(R.layout.main_fragment, container, false);
    } 
	 
	@Override 
	public void onAttach(Activity activity) {
		super.onAttach(activity);
		try { 
			mainActionListener = (OnMainActionListener) activity;
		} catch (ClassCastException e) {
			throw new ClassCastException(activity.toString() + " must implement OnMainActionListener");
		} 
	} 
}