@Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); menu.setHeaderTitle("Select The Action"); menu.add(0, v.getId(), 0, "remove");//groupId, itemId, order, title menu.add(0, v.getId(), 0, "SMS"); } @Override public boolean onContextItemSelected(MenuItem item){ AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo(); bcc=Double.parseDouble(tv1.getText().toString()); int itemCount = l1.getCount(); int i=0; if(item.getTitle()=="remove"){ if (c1=="mosab"){ adapter.remove(strAA.get(i)); bcc=bcc-20; tv1.setText(Double.toString(bcc)); } else if (c2 == "ahmad"){ adapter.remove(strAA.get(i)); bcc=bcc-30; tv1.setText(Double.toString(bcc)); } } else if(item.getTitle()=="SMS"){ Toast.makeText(getApplicationContext(),"sending sms code",Toast.LENGTH_LONG).show(); }else{ return false; } return true; }
onContextItemSelected
i
strAA
tv1
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)