Code example for ListFragment

Methods: onCreateContextMenu

0
 
    } 
	 
	@Override 
	public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
		super.onCreateContextMenu(menu, v, menuInfo);
 
		info = (AdapterContextMenuInfo) menuInfo;
		menu.setHeaderTitle("Crossing options"); //(crossingList.get(info.position).getTitle2());
		menu.add(Menu.NONE, info.position, 0, "View");
		menu.add(Menu.NONE, info.position, 0, "Delete");
	} 
 
	@Override 
	public boolean onContextItemSelected(MenuItem item) {
		if(item.getTitle() == "View"){
			Intent intent = new Intent();
			intent.setClass(getActivity(), BookListActivity.class);
	        if(item.getItemId() == 0)
	        	intent.putExtra("all", 1);
	        else if(item.getItemId() == 1)