Code example for ListFragment

Methods: getArguments, onCreate, setHasOptionsMenu

0
	private String searchQuery;
	private SimpleCursorAdapter adapter;
 
	@Override 
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setHasOptionsMenu(true);
		Bundle args = getArguments();
		if (savedInstanceState != null) {
			args = savedInstanceState;
		} 
		searchQuery = args.getString(SearchManager.QUERY);
	} 
 
	@Override 
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);
		setListShown(false);
		adapter = new SimpleCursorAdapter(getActivity(), android.R.layout.simple_list_item_2, null,
				new String[] { DB.Entries.NAME_NAME, DB.Entries.NAME_FULL_NAME },
Experience pair programming with AI  Get Codota for Java