i have listview the fisrt time i when i click to row it open the context menu then i override the oncontextitemselected
public boolean onContextItemSelected(MenuItem item) {
switch(item.getItemId()) {
case CALL_ID:
{
AdapterContextMenuInfo info2 = (AdapterContextMenuInfo) item.getMenuInfo();
String phone=mDbHelper.getPhone(info2.id);
String toDial="tel:"+phone.toString();
startActivity(new Intent(Intent.ACTION_DIAL,Uri.parse(toDial)));
return true;
}
}
return super.onContextItemSelected(item);
}
this do correctly but when i
public boolean onMenuItemSelected(int featureId, MenuItem item) {
switch(item.getItemId()) {
case CALL_ID:
{
AdapterContextMenuInfo info2 = (AdapterContextMenuInfo) item.getMenuInfo();
String phone=mDbHelper.getPhone(info2.id);
String toDial="tel:"+phone.toString();
startActivity(new Intent(Intent.ACTION_DIAL,Uri.parse(toDial)));
return true;
}
return super.onMenuItemSelected(featureId, item);
}
}
the app crashed can u show me the difference between them
Try this:
context_menu.xml (res/menu/context_menu.xml)
Context Menu:
AndroidManifest.xml
That should work.