Code example for ListFragment

Methods: getListView, getActivity, onActivityCreated, setHasOptionsMenu

0
		this.menu = menu;
		this.layout = layout;
	} 
 
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);
		setHasOptionsMenu(true);
 
		if (listViewId != 0) {
 
			listView = getListView();
			if (headerView() != null) { 
				listView.addHeaderView(headerView());
			} 
			// listView.setOnItemClickListener(this); 
			android.view.View emptyView = getActivity().findViewById(
					android.R.id.empty);
			if (emptyView != null) {
				listView.setEmptyView(emptyView);
			} 
			 
			view = Objects.createInstance(viewClass, Activity.class, getActivity());
			adapter = Objects.createInstance(adapterClass, Context.class, getActivity());
 
			listView.setAdapter(adapter);
			listView.setFocusable(true);
			listView.setFocusableInTouchMode(true);
		}