Android :: Create Static Options Menu For All Activity Screens
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
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
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
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
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
Oct 28, 2009
I frequently run into the problem that I have to preserve state between several invocations of an activity (i.e. going through several onCreate()/onDelete() cycles). Unfortunately, Android's support for doing that is really poor. As an easy way to preserve state, I thought that since the class is only loaded once by the class loader, that it would be safe to store temporary data that's shared between several instances of an activity in a static Bundle field. However, occasionally, when instance A creates the static bundle and stores data in it, then gets destroyed, and instance B tries to read from it, the static field is suddenly NULL. Doesn't that mean that the class had been removed and reloaded by the classloader while the activity was going through a create/destroy cycle? How else could a static field suddenly become NULL when it was referencing an object before?
View 2 Replies
View Related
Jul 4, 2010
I have a TabActivity which contains an Activity. When the tab for the activity is selected, if I press the Menu button, onPrepareOptionsMenu is called in the parent TabActivity, but not on the activity for the tab which was selected. The options menu for the activity in the tab isn't shown unless I click inside the tab, then I get calls to both (which is what I want). Is there any way to 'focus' the activity in the tab when the tab is selected?
View 1 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
Apr 27, 2010
I have some C++ code that I want to make into a static lib for use with Java on the Android platform. Can anyone point me to a resource that tells me how to do this? I am completely new to Java and Android.
View 2 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
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
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
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
Feb 4, 2010
I have a static library: libhello.a and I want to create a executable file that link with this static library:Code...
View 3 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
Feb 19, 2010
I ask something about static library..
" how to create executable static library in android?"
and
"How to connect static library in eclipse?"
Static library is a binary file, How to understand static library in jni?
I wondering static library operation method in android.. (such as static library in vc++).
View 1 Replies
View Related
Nov 17, 2010
Static Layout for whole app that must be in all Activity
View 12 Replies
View Related