Code example for ListFragment

Methods: getListView, onCreateContextMenu

	// Creates the context menu 
	public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
		super.onCreateContextMenu(menu, v, menuInfo);
		if (v.getId() == this.getListView().getId()) { 
			menu.setHeaderTitle("Select action"); 
			menu.add(0, 0, 0, "More info");
			menu.add(0, 0, 0, "Remove");
	// Handles the context menu item selection events 
	public boolean onContextItemSelected(MenuItem item) {
Connect your IDE to all the code out there  Get Codota for Java