Android :: Alter MenuItem On The Options Menu?
Nov 16, 2010
I have an Options Menu on my Activity with an MenuItem "Start". When this MenuItem is selected I would like to alter the Menu so it contains a MenuItem "Stop". And finally when "Stop" is selected, I would like to alter back to "Start". Here is parts of my code that isn't working. I have both "Start" and "Stop" listed in mymenu.xml I should probably remove "stop" when the menu is created:
public class MyActivity extends Activity {
private boolean isStarted = false;
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
menu.removeItem(R.id.stop);
inflater.inflate(R.menu.mymenu, menu);
return true;....................
View 2 Replies
Mar 25, 2009
I am trying to use menu button for my application menu. When I add upto 3 MenuItem it show them in a single row, but if i add one more it shows two rows and that's not what I want.
View 2 Replies
View Related
Nov 19, 2010
I have an Options menu up and running in my Android application and I've overridden the onCreateOptionsMenu, onOptionsItemSelected and onPrepareOptionsMenu methods to customize the menu a little. My question is related to keeping the Options menu open after the user clicks on a menu item. Basically, I'd like to be able to hide the menu until the user clicks on the device menu key. Once the user clicks on this key, I'd like to be able to hold the menu in place regardless of how many times the user clicks on menu items. If the user wants to hide the Options menu, they'd just need to click on the device menu key again. Is this type of interaction supported (or even advisable).
View 1 Replies
View Related
May 27, 2010
Android question. If i create an Options menu with menu.xml, can I change the menu buttons' standard text size, color etc using xml? I would like to change text size, bold, and color. I would like to avoid using themes and styles for this application.
View 1 Replies
View Related
Aug 4, 2010
I was trying to set up my options menu so that there would be 2 buttons on the 1st and 2nd row and then 1 button on the 3rd row. Here is the code I was trying to use but I'm guessing groupID argument isn't what I thought it was.
menu.add(1, MENU_NAME, 1, "by Name");
menu.add(1, MENU_NUMBER, 2, "by Number");
menu.add(2, MENU_POSITION, 1, "by Position");
menu.add(2, MENU_COLLEGE, 2, "by College");
menu.add(3, MENU_UPDATE, 1, "Update Roster");
Maybe this is solved somehow with the XML Layout but I'm not really good with the layouts ;( So I managed to not get too far that way either.
View 1 Replies
View Related
Jul 7, 2010
In my application, I have extended SurfaceView and ListView. I create a LinearLayout as below
mainForm = new LinearLayout(this); mainForm.setOrientation(LinearLayout.VERTICAL); mainForm.setLayoutParams(new LinearLayout.LayoutParams( LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.FILL_PARENT));
I then add the SurfaceView and ListView to the mainForm and then setContentView(mainForm);
I also override onPrepareOptionsMenu and call menu.clear() and then dynamically create menus each time the menu button is pressed by the user. The application loads fine and the SurfaceView works fine as I directly draw images to it in a sleep loop. The ListView displays items and is desined to refreshed with new items. The options menu also displays once as well................................
View 2 Replies
View Related
Sep 12, 2009
I am trying to manage the options items, making one button visible and another invisible based on whether a background service is active.
Here's a snippet of my menu/option.xml: <item android:id="@+id/arm" android:title="Arm" /> <item android:id="@+id/disarm" android:title="Disarm" android:visible="false" android:enabled="false" /> ......................................
View 3 Replies
View Related
Jun 28, 2010
I like to call a menu already created an activity without using the button on the smartphone.
View 3 Replies
View Related
Sep 9, 2010
The problem is that the following method gets called one time when the Menu button is pressed: public boolean onCreateOptionsMenu(Menu menu) How can I recreate the menu at a later time in order to change some options, disable some options, etc?
View 1 Replies
View Related
Jan 6, 2010
I cant seem to open a new view from an options menu item. The program keeps crashing as it applies the intent and listener to the item. I am just beginning, so please be nice. The current view is mnf sms, and the view I am trying to open is mnf sms_settings. I am developing for 1.5. Could someone please help me get the menu working. The menu (called options_menu.xml): Code...
View 5 Replies
View Related
Aug 31, 2010
Sharing an Options Menu between Activity and Map Activity. Is this possible? I have an Options Menu shared between multiple Activities but now I need that menu in a Map Activity.
View 1 Replies
View Related
Jan 27, 2010
I am trying to display menu options while showing an AlertDialog i.e. when MENU key is pressed, it should show whatever options that have been created. I read the following in the Dev Guide at....................
View 2 Replies
View Related
Jun 17, 2010
Is it possible to create a dynamic context menu in android? What I mean is, for example, if I have a list of items, that can be in two states: "read" and "unread". I want to be able to bring up a context menu with an option of "Mark as Read" for the unread items, and "Mark as Unread" for the read items.....
View 1 Replies
View Related
Oct 8, 2009
I am writing an activity where the user is supposed to some editing and is critical. In this activity, I dont want pressing of Call key to make it go to Call Log so I handle onKeyDown call back and there if the key pressed is Call, I just return true. That solves my problem. But, if Options menu is opened and then I press Call button, I am not getting control in onKeyDown.
View 8 Replies
View Related
Nov 10, 2009
Can Activity "A" open the options menu of a view in Activity "B"? In this case I am building Activity A but Activity B can be any other running activity. I think this is an impossible security violation but I really want someone to prove me wrong.
View 2 Replies
View Related
May 2, 2010
I created a basic options menu, here an example of creating an element of me menu: menu.add(0, MENU_BACKWARD, 0, "").setIcon(R.drawable.btn_backward);
As you can see I don't want to show any text in this menu, just an icon ! But when the menu is showed, there is a "ugly" blank under the icon (the text is supposed to be there) and I want to avoid this. A least if it's possible to center the icon the options menus, it will be great.
View 2 Replies
View Related
May 31, 2010
I'm trying to change the default color for the options menu which is white. I want a black background for every item on the options menu. I've tried some shoots like android:itemBackground="#000000" on the item element within the menu element but it doesn't work. I don't know if this is doable or not. Any idea would be welcome! :)
View 1 Replies
View Related
Jun 20, 2010
I want to have an options menu that is available to all Activities in my app (on pressing the MENU button). I've been doing this by creating it in onCreateOptionsMenu(Menu menu) for each Activity but this seems redundant. Is there a way to create it in one place and have it available in all Activities?
View 1 Replies
View Related
Aug 7, 2010
I am attempting to get my app to open a settings menu screen and return. The problem I am having is when in the settings page, upon pressing the back button, the app closes. I am VERY new to programming in general after fighting this for about 8 hours. code...
View 1 Replies
View Related
Nov 16, 2010
I want to create a custom OptionsMenu in my application. The default OptionsMenu display only three items in one row. Now i want to display five to six items having only icons. Also i want to change the background color of the OptionsMenu but not getting the appropriate way of doing this. If it is possible then please let me know about it.
View 1 Replies
View Related
Nov 24, 2010
I have a options-menu (when u press menu key of the phone), with 5 buttons, all of them with one 48x48 image and text. now the buttons need's two columns to be displayed, but i want to reduce the size of them to fit one column with all of the buttons how i can achieve this? i can do it with parameters on layout xml menu file?
View 2 Replies
View Related
Jan 15, 2010
I wanted to create a static options menu for all my activity screens. I dont want to override onCreateOptionsMenu() in each activity. Since Menu class is an interface with a huge number of methods, its difficult to create a static object of the implementing class.
View 3 Replies
View Related
Oct 7, 2010
I want to use addIntentOptions to drive my menus when ever possible. This seems the cleanest way to provide them. Rather than explicitly detailing activities, simply ask for a menu listing all the activities which are available for my data item.So I'm trying to put together a context menu for a List View. It works great. Only problem is that I have an activity that has two intents that consume my data type, and only the first shows up.The activity in question in Android Manifest.xml
<activity android:name=".ui.MyActivity" android:label="The title">
<intent-filter android:label="First context label">
<action android:name="com.sample.action.FIRST_ACTION" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.ALTERNATIVE" />
<category android:name="android.intent.category.SELECTED_ALTERNATIVE" />
<data android:scheme="myscheme" />
</intent-filter>
<intent-filter android:label="Second context label">
<action android:name="com.sample.action.SECOND_ACTION" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.ALTERNATIVE" />
<category android:name="android.intent.category.SELECTED_ALTERNATIVE" />
<data android:scheme="myscheme" />
</intent-filter>
</activity>
View 1 Replies
View Related
Jul 10, 2010
The options menu has a translucent background and I would like to make it solid and nontransparent. Is there a way?
View 1 Replies
View Related
Jun 18, 2010
I have looked everywhere for the answer to this question, but cannot find anything on it.
View 2 Replies
View Related
Dec 17, 2012
I have a menu with options, and from there...you get another menu screen for completely different options, but the second simple list, nothing happens when you pick.
View 1 Replies
View Related
Sep 12, 2010
i have problems with my recovery menu options. running clockwork mod & i only have the following 4 options in my recovery menu.
1-reboot system now
2-apply sd card: update zip
3-wipe data factory reset
4-wipe cache partition
underneath is the message
e: can't open /cache/recovery/command. without a restore option, i cannot change mod's or kernels--or if i can, i don't know how. i've tried to flash sprecovery from rom manger, but the menu options do not change. any ideas how i can solve this issue?
View 6 Replies
View Related
May 2, 2012
I'm looking to remove and add some options to the CM7 power menu.
I've been building CM7 from original source so which files control what's displayed in the power menu? There are just so many files it's going to take a very long time to work out which ones I need to modify.
View 2 Replies
View Related
Aug 8, 2010
Does anyone know of a relatively easy way to change the font of the Android OS? Right now I'm using WW and tried Googling it but couldn't find anything i could make sense of other than a tutorial written in very bad English.
View 4 Replies
View Related
Nov 21, 2010
when I long press on my homescreen to add a widget (say Pandora's widget) I have to scroll through a TON of crap. 5 different beautiful widget options, 7 calendar pad pro options, 6 contact widget options, 6 folder organizer widget options, etc. Most of those I know I will NEVER EVER use. How can I remove them from my "choose widget". My phone is rooted, and one app I used, pure calendar, gave me the option of which "choose widget" menu options to show. So I know it exists somewhere.
View 2 Replies
View Related