> I added 2 menus.
>
>         menu.add(0, 1, 0, "Start");
>         menu.add(0, 2, 0, "Stop");
>
> public boolean onOptionsItemSelected(MenuItem item)
>     {
>         switch (item.getItemId()) {
>         case 1:
>             if(item.getTitle().equals("Start"))
>             {
>                 item.setTitle("Pause");
>             }
>             return true;
>         case 2:
>
>             return true;
>         }
>         return false;
>     }
>
>
> when i click the stop menu, the start menu name should be changed.
>
> How to change that?...

The best answer, IMHO, is to override onPrepareOptionMenu() instead of
onCreateOptionMenu(), so you get called every time the user pops up the
menu. Then, build the menu with the caption/icons you want.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html


-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to