views:

622

answers:

2

hey … i want to open up options menu by clicking upon my own created button … is it possible ? if so, please help me out … thanks in advance

A: 

Use the openOptionsMenu() method of your Activity to open the Menu programatically.

Still, what Nikola said is right - you'd be better conforming with Android's guidelines.

Dimitar Dimitrov
thanks fort your help ... it works ... the project i am working on requires to open up options menu by clicking on a customized button.have you done anything like adding a view on top of camera view? i have been exploring and experimenting for a couple of days but still i cant get it done. i hope you can help me out.
sam
+1  A: 

If you don't want to use the button of the phone, you have to do the following :

define a listener on your button:

openMenuButton = (Button) findViewById(R.id.yourButton);
    openMenuButton .setOnClickListener(this);

and then in the method onClick(), add :

openOptionsMenu()
Sephy
thanks Sephy ... it works ... have you done anything like showing something on top of camera view?
sam