Is it possible to add a new Menu Item to other application's Option/Action menu?
For example:
In phone's contacts menu, I want to add a new menu item "Share on Orkut (example)".
Is it possible in Android?
Thanks
Souvik
No, its not possible to modify other applications' behavior in code
Related
Putting a ShareActioProvider in an action bar and setting an intent on it is an easy way to share content on Android.
I would like to add my own action (e.g. "Add Bookmark", "Save for Later" etc) in the drop down menu that appears on screen when you tap on the share menu item. Is this possible?
I thought about creating an intent filter to capture the share intent within the app but I don't know if this would be the correct approach.
The ShareActionProvider should deal exclusively with share actions. Android provides ways for adding other custom actions (buttons) on the ActionBar.
The example provided on the official docs shows how to add a 'search' button. Thus, you can add your bookmark/save buttons alongside the share action provider one.
Additional actions can be moved to a spill-over button if there's too many of them to fit in the action bar.
I need to open android support library action bar overflow menu (the one shown with three vertical dots) programatically. I know its a silly requirement but one of my client is insisting that they want the menu option to be opened and visible when user tap on a button in an activity.
Any pointer on how to do this will be highly appreciated.
Try using openOptionsMenu in your Activity.
You can do something similar to this implementing your own custom ActionProvider Check this out, in the "Creating a custom action provider" section.
Hope it helps
I need something that looks like a popup menu in Android 1.5 that I can trigger from a button press.
(the version number is a hard limit, by the way)
According to the documentation, an ordinary popup menu is supported, but only in Android 3.x and higher.
I'd prefer to do it without adding another Activity, but can if that's the best option.
I already have the menu defined in XML, I just need to figure out how to make it display.
I think you are looking for a Dialog. I recommend you to use AlertDialog, as it is easier to use through its Builder class. You will be able to use your custom XML to define the layout for the Dialog.
It is available since API level 1, so you would not have problems. Here you have doc info AlertDialog
If you want that pop up menu to display more options, I suggest using the QuickAction. It is not available in Android SDK so you're gonna have to build it manually
//Add action item
ActionItem addAction = new ActionItem();
addAction.setTitle("Add");
addAction.setIcon(getResources().getDrawable(R.drawable.ic_add));
//Accept action item
ActionItem accAction = new ActionItem();
accAction.setTitle("Accept");
accAction.setIcon(getResources().getDrawable(R.drawable.ic_accept));
//Upload action item
ActionItem upAction = new ActionItem();
upAction.setTitle("Upload");
upAction.setIcon(getResources().getDrawable(R.drawable.ic_up));
Looks like this
More information on how to implement it is available here
I am trying to find a way to impelement a share button into my app (same like the one in the standard ICS gallary app, see picture link).
http://betanews.com/2011/10/19/get-acquainted-with-the-newest-android-ice-cream-sandwich-slideshow/#11
Intent.ACTION_SEND only opens a dialoge to the select the sharing options.
Android Share Via Dialog
This works fine, but from design side, I find this drop down list to select a app much more convenient.
Yet I cant figure out how to?
Does anybody have a good Idea how this button could be coded?
That is implemented using a ListPopupWindow, which at the moment is only available on Android 4.0.
This is implemented using ShareActionProvider available in SDK14+.
ActionProvider class replaces an action item with a customized layout,
but it also takes control of all the item's behaviors. When you
declare an action provider for a menu item in the action bar, it not
only controls the appearance of the item in the action bar with a
custom layout, but also handles the default event for the menu item
when it appears in the overflow menu
Its quiet easy to implement, you can follow the official documentation here.
Can you please suggest to me how to add a menu item in the system menu? For example, I would like to add a shortcut to my application in the system contacts menu.
If you want to integrate into contacts , try this :
http://www.mostlybaked.com/android-contacts-integration
http://developer.android.com/resources/articles/contacts.html