Code example for ListFragment

Methods: onListItemClicksetListAdapter, getActivity

0
		getListView().setCacheColorHint(0);
	} 
 
	@Override 
	public void onListItemClick(ListView l, View v, int position, long id) {
		super.onListItemClick(l, v, position, id);
		MainActivity.getInstance().setBackButtonIcon(false); 
		MainActivity.getInstance().setView(position);
		((MenuActivity) getActivity()).getSlideoutHelper().close();
		setListAdapter(menuAdapter);
	} 
 
	public static void setSelected(int position) {
		if (menuAdapter != null)
			menuAdapter.setSelected(position);
	} 
} 
Connect your IDE to all the code out there  Get Codota for Java