Q:

How to make a button in android to pops up a menu?

I want a menu (the one that is triggered by the Menu button on the device) to work from a click on a normal button (an on screen one, of course)..
in a way to "replace" the Menu button on the device on one that is on screen.
Any ideas?

A:

Easily
public void onClick(View v){
    openOptionsMenu(); 
}

Then to override the menu buttons behavior (this is not really reccomended) you can do something like this
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
    if ( keyCode == KeyEvent.KEYCODE_MENU ) {
        Log.d(TAG, "MENU pressed");
        return false;
    }
    return super.onKeyDown(keyCode, event);
}

