How to use Option Menu without menu button?

2.5k Views Asked by At

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 ?

2

There are 2 best solutions below

1
On BEST ANSWER

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.

0
On

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.