Issue
I have an app with a custom built e-mail client functionality. The e-mail body is shown in a webview. If there is an e-mail address in the body of a e-mail, then the webview detects it and makes it clickable. When the user would click on the e-mail address, then Android shows a prompt asking which e-mail app the user would like to open.
Is it possible to catch it when my app tries to open a e-mail intent/app? I would like to open my own Activity for it.
Solution
I have thought about it and decided to make my app support sending e-mails. So if the user tries to start an e-mail intent to send mails, my app is also shown now as an e-mail app.
Thanks to @Ravi to bring me on this idea.
I have used this intent filter:
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<action android:name="android.intent.action.SENDTO"/>
<data android:scheme="mailto"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
</intent-filter>
<intent-filter android:label="@string/realworks_email_opstellen">
<action android:name="android.intent.action.SEND"/>
<data android:mimeType="*/*"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
<intent-filter android:label="@string/realworks_email_opstellen">
<action android:name="android.intent.action.SEND_MULTIPLE"/>
<data android:mimeType="*/*"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
Answered By - com2ghz
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.