When clicking an email address from a browser or contacts app...
Is there any way for my app to show a mail client in the intent list?
When clicking an email address from a browser or contacts app...
Is there any way for my app to show a mail client in the intent list?
You need to use an
Intent Filter
. Check out http://developer.android.com/guide/topics/intents/intents-filters.html for more information. You usually declare these in your manifest file. The intent I believe you're looking for isIntent.ACTION_SEND
.As you can see from the Mail application's source, having your application catch the intent is as simple as adding the
intent-filter
to yourAndroidManifest.xml
inside your mail compositionactivity
definition.You can see that the
<data>
tag specifies to handlemailto:
links. TheBROWSABLE
category means it can be launched from the browser.K-9 Mail is similar, except using the
SENDTO
action only with theDEFAULT
category, and theVIEW
action only with theBROWSABLE
category.