• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Creating ActionBar menu

Hi all,
I am working on mapactivity for googlemaps api. I created options menu which includes 5 different menu items. What I need is whenever I click on each of the menu item it should open another menu may be something similar to contextual action mode which should contain some views like button and a text editfield. I need to enter address in edit field and button to click on GO which should thereby locate the address on the map.

Can some one suggest me how?
What I did is, in OnOptionsItemSelected() I am passing setcontentview with new ref.id(xyz.xml) which contains edittext and button. But I am not able to pass button.setonclicklistener() after that. The application gets crashed running this peace of code.
I think this is a wrong way of doing but I didn't find any other way to get the options with edit and button. I am working on java.

Thanks,
Chanukya
 
Take a look at this tutorial:
How to create an option menu on Android Development

I should also suggest that you steer away from Options Menus all together as since the advent of Honeycomb (Andorid 3.0) it has been suggested that ActionBars be used instead and is a requirement if you wish to be included in the featured apps section of the Play Store (Formerly, Android market).
 
Back
Top Bottom