• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Alternative Menus in Android's Native Email Application

Tasneem

Lurker
Hi,
I am a Newbie in android and i wanted to add a menu option in native email app in android . I have used intent filters but i am not successful in achieving it.
Actuaaly i want to a menu option to the native mail application in Android.. so that my activity / app can be launced on clicking that option. This feature has been successfully achieved in Blackberry and even in android for gallery application.
On android i have achieved it by using intent filters.
<activity android:name=".DisplayAlternativeMenu"
android:theme="@android:style/Theme.NoTitleBar">
<intent-filter android:label="My Activity">
<action android:name="android.intent.action.SEND"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.ALTERNATIVE"/>
<data android:mimeType="image/*" />
</intent-filter>
/activity>
This basically display an menu item"My Activity" when u press share in Gallery. and clicking on that launches my activity
But unfortunately it didn't work for Email Application.
Looks like the pair of action & mimetype i am specifying is not correct.
Can you please tell me which action & which mimetype should be used. Also if there are any permission required,what are they?

My aim is to add an alternative menu while pressing menu in Compose Email(When a mail is composed) of the native email application


Thanks
Tasneem
 
I dont think you can change menus in another app unless you fully replace that app, no?

At least I hope not.
 
Hello,
Thanks for the input. But I think Android has provided this feature (with the help of intent filter) to add our menu item to other applications. We tried to add Alternative Menu Item in Gallery>share menu option and we were successful but are not able to add a menu item to Email application. Is it possible to add an alternative menu item to Email application. Its our requirement. Is there any other alternative method to achieve it?
 
I get what you're saying but you seem to be asking two different questions. However, I will answer the more likely question as the other seems to be a language barrier thing.

From the Docs:

Intent Resolution

There are two primary forms of intents you will use.

  • Explicit Intents have specified a component (via setComponent(ComponentName) or setClass(Context, Class)), which provides the exact class to be run. Often these will not include any other information, simply being a way for an application to launch various internal activities it has as the user interacts with the application.
  • Implicit Intents have not specified a component; instead, they must include enough information for the system to determine which of the available components is best to run for that intent.
also:

Set if the activity should be considered as an alternative action to the data the user is currently viewing. See also CATEGORY_SELECTED_ALTERNATIVE for an alternative action that applies to the selection in a list of items.
Supporting this category means that you would like your activity to be displayed in the set of alternative things the user can do, usually as part of the current activity's options menu. You will usually want to include a specific label in the <intent-filter> of this action describing to the user what it does.
The action of IntentFilter with this category is important in that it describes the specific action the target will perform. This generally should not be a generic action (such as ACTION_VIEW, but rather a specific name such as "com.android.camera.action.CROP. Only one alternative of any particular action will be shown to the user, so using a specific action like this makes sure that your alternative will be displayed while also allowing other applications to provide their own overrides of that particular action.

Constant Value: "android.intent.category.ALTERNATIVE"

I don't think the compose email activity would send an implicit intent you could hook into, rather it will send it's own internal intent to it's own send service.
 
Hello,
Thanks for the information shared by you. But my problem has not yet been resolved. Actually, we are able to add the alternative menu item at various places in Gallery, contacts, Browser but are not able to add it in compose section of email form. Please help us in resolving this issue.

Thanks
Tasneem
 
Hi Tasneem,

I am also looking exactly for the same requirement (adding alternative menu to email application). Please let me know if you could achieve this.
Also can you pls help me in adding menu item to browser (i need the mime type to be specified).
I could add my menu item to Gallery (under share) and Contacts and now want for email and browser tooo.

Please help...

Thanks,
Mamatha
 
Hi..

Even I want to know something of this sort..

But in my case, I don't want to create an alternate menu. instead, I just want to add one item in the Menu in SMS (messaging) application.

ex:-
When I open the message to read from Inbox folder,
The menu displays Forward, Reply, Delete, Move to,... options.
along with this I want to add one more option of my own.

Is this possible?

Hope to get a reply.


regards,
Vijayan
 
Back
Top Bottom