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, v.getId(), 0, "View");
		menu.add(Menu.NONE, v.getId(), 0, "Delete");
	} 
 
	@Override 
	public boolean onContextItemSelected(MenuItem item) {
		if(item.getTitle() == "View"){
			//Intent intent = new Intent(); 
            //intent.setClass(getActivity(), CrossingActivity.class); 
            //intent.putExtra("index", item.getPosition()); 
           // startActivity(intent);