registerForContextMenu(validate_button);
@Override
public void onCreateContextMenu(ContextMenu menu, View v,
ContextMenu.ContextMenuInfo menuInfo) {
menu.add("It's right");
menu.add("It's wrong");
}
@Override
public boolean onContextItemSelected(android.view.MenuItem item) {
//i want to show another Context Menu to select next answer
return true;
}
How to show another ContextMenu when I click an item of the first ContextMenu?.
Its something like a questioner where you select answers from the ContextMenu items, depending on which next ContextMenu items must be Populated
I don’t know how deep you want the
ContextMenuto be but for two levels you could have a boolean flag, to select between the two cases, which will be updated fromonContextItemSelected:Then in the
onContexItemSelectedcallback simply update the flag and post a Runnable to show theContextMenuagain:Anyway, I would advise against such code and simply use a custom
Dialog(or aDialogFragmentto have a backstack for the user to cycle through).