[android-developers] Need Help in Options Menu

2011-11-25 Thread Kiran Kumar Kendole
Hi Guys, I am trying to design a options menu. I tried it, working fine. But the problem , It is showing same options for all pages. My requriement is In Home Page ( I need only EDIT, DELETE,ATTACH options) Second Page ( I need only BACK , HOME , EXIT options). Like I want some of the options

Re: [android-developers] Need Help in Options Menu

2011-11-25 Thread Johan Rydenstam
Several ways to do this. One solution is to have two XML files that defines the different menus. On Nov 25, 2011, at 9:19 AM, Kiran Kumar Kendole wrote: Hi Guys, I am trying to design a options menu. I tried it, working fine. But the problem , It is showing same options for all pages.

Re: [android-developers] Need Help in Options Menu

2011-11-25 Thread Kiran Kumar Kendole
Thanks for the reply. I have two XMLs. And One Activity Class. there I used one XML like this. *public boolean onCreateOptionsMenu(Menu menu) {* *MenuInflater inflater = getMenuInflater();* *inflater.inflate(R.menu.optionsmenu, menu);* *return true;* *}* * * But it is

Re: [android-developers] Need Help in Options Menu

2011-11-25 Thread Johan Rydenstam
How do you know what menu you want? You could start the activity by passing in some extra parameter with the intent. public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); if(getIntent.getBooleanExtra(second_menu,true))

Re: [android-developers] Need Help in Options Menu

2011-11-25 Thread Kiran Kumar Kendole
Thanks. It worked after using Intent. Any other way.. with using one XML file. Thanks, KIRANKUMARKENDOLE On Fri, Nov 25, 2011 at 4:07 AM, Johan Rydenstam johanrydens...@googlemail.com wrote: How do you know what menu you want? You could start the activity by passing in some extra

Re: [android-developers] Need Help in Options Menu

2011-11-25 Thread Johan Rydenstam
You can add and remove buttons programatically. Don't how by heart. Google it :) On Nov 25, 2011, at 10:43 AM, Kiran Kumar Kendole wrote: Thanks. It worked after using Intent. Any other way.. with using one XML file. Thanks, KIRANKUMARKENDOLE On Fri, Nov 25, 2011 at 4:07 AM, Johan