The easiest way is to capture the onKeyDown event for the menu button click:
@Override
public
boolean
onKeyDown(
int
keycode, KeyEvent event ) {
if
(keycode == KeyEvent.KEYCODE_MENU)
{
AlertDialog.Builder dialogBuilder
=
new
AlertDialog.Builder(
this
)
.setMessage(
"Test"
)
.setTitle(
"Menu dialog"
);
dialogBuilder.create().show();
}
return
super
.onKeyDown(keycode,event);
}
No comments:
Post a Comment