Android :: Can One Activity Open Another Activities Options Menu?
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
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
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
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
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 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
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
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
Apr 8, 2010
I am trying to make an exit button for my application. Anyhow I am able to track all the instance of activity in my application and then finish them all. But still some activity remain alive in some cases. Dont know how. Is there any method to kill a particular application in android. Or any other way can I exit from my application.
View 1 Replies
View Related
Jan 13, 2010
I'm trying from main Activity (MainFile.java) to open a Map as a new intent through a menu. Something like this...
CODE:..............
And I already have set up thing on my manifest.xml with access to...
CODE:........
It worked fine with other File.class, but with the Map.class doesn't seem to be working.
View 1 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
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
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
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
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
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
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 19, 2010
Is there any way to open the menu option via the code, sort of auto trigger on a particular action.
View 1 Replies
View Related
Jun 22, 2010
I have two activities that both contain an identical context menu built programmatically using menu.add(int, int, int, CharSequence). They both use onCreateContextMenu and onContextItemSelected.
The first Activity contains a ListView, when the user long presses on an item the context menu appears for that item. The second Activity (a detail screen for each item in Activity 1) contains a button, when the user presses the button the context menu appears.
I'd like to share the code that creates the context menu between these activities. The only thing these activities share is the context menu, so it seems like a bit of overkill to create a superclass (e.g., ActivityOne extends ContextMenuActivity) that defines onCreateContextMenu and onContextItemSelected methods.
Is there a better way of sharing these methods between activities?
View 2 Replies
View Related
Jul 17, 2010
I have 10-15 activities in my project. I want to have the option menu mostly in all Activities. Then is their any way we can do it at one place and it appears in all activities.
Also, I will like to hide the option menu in some. So, is it possible or I have to write option menu code in all activities.
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