in my application I have option menu it run with menu button on phone my question is, if my phone has no button how it is work ?
Asked
Active
Viewed 2,460 times
2 Answers
9
OK. Here is the deal*(Considering you know how to create options menu)*. Sometimes this might become a problem to notify the user that there is some options hidden in the method. So simply you can use any buttons or images or any widgets you have used in your app to open up your options menu. Here is a sample of how it works,
button.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
openOptionsMenu();
}
});
Calling the method, openOptionsMenu()
I believe will solve your problem.

Andro Selva
- 53,910
- 52
- 193
- 240
-
I call oncreateoptionsmenu( ) and use onoptionsitemselected( ) for set selected option automatically press phone's menu button it work but I noticed smart phones has no buttons – gulsen Jan 16 '12 at 05:52
0
It's responsibility of your phone to enable the menu somehow. One of the (most popular) ways of doing it is using on-screen soft buttons.
Either ways, thats the responsibility of the phone manufacturer, you can leave it out of your things-to-worry-about.

Vikram Bodicherla
- 7,133
- 4
- 28
- 34