I have a Button/Edittext to reset my App-Settings….
If a press the button(no long click), I want to get a Contextmenu with a Button where i can confirm the reset or not!
Which listener do i need for my Button to call a ContextMenu?
Is a also possible to create a contextmenu by this method?
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
//create Contextmenu to confirm or not
return true;
}
return super.onKeyDown(keyCode, event);
}
and how can i get a Textview or a Button in a ContextMenu() ?!?
Do u have any suggestions?
I don’t think you can actually start the
ContextMenuon aButtonclick(this menu could be handled directly by the Android system).You should use a
Dialog(orAlertDialog) to get your user choice.