Regarding menu option

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Regarding menu option

Postby saty_32016 » Wed Apr 16, 2008 4:49 am

Hi All,

I am trying to implement gallery with menu option what i want is to have mark and unmark menu with check
box implementation. i want to dynamically change menu "Mark to Unmark " and vice versa. and when in gallery image change by left and right key press i want to reload menu options again . any idea guys.............

Thanks In advance
Saty
saty_32016
Developer
Developer
 
Posts: 27
Joined: Mon Mar 10, 2008 4:47 am

Top

Postby plusminus » Fri May 23, 2008 9:23 am

Hello saty,

maybe toe [font=Courier New]onPrepareOptionsMenu[/font]-Callback (just paste this to your Activity) is what you are looking for. I use it to dynamically update the menu buttons, for a kind of Toggle-Button:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.         @Override public boolean onPrepareOptionsMenu(final Menu menu) {               
  2.                 if(super.mMapView.isTraffic())
  3.                         menu.findItem(MENU_TRAFFIC_ID).setIcon(R.drawable.traffic_off_48);
  4.                 else
  5.                         menu.findItem(MENU_TRAFFIC_ID).setIcon(R.drawable.traffic_on_48);
  6.  
  7.                 return super.onPrepareOptionsMenu(menu);
  8.         }
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Exabot [Bot] and 5 guests