メールのリンクからアプリを起動したい。このリンクは特別なスキーマに基づいています。
アプリのアクティビティ (AndroidManifest.xml) で使用します。
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="ace" android:host="samuel"/>
</intent-filter>*
私のアプリでは、ユーザーが「メールで共有」ボタンをクリックすると、Gmail アプリが開き、メールが送信されます。
Intent mailIntent = new Intent(android.content.Intent.ACTION_SEND);
mailIntent.setType("plain/test");
mailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{});
mailIntent.putExtra(android.content.Intent.EXTRA_CC, new String[]{});
mailIntent.putExtra(android.content.Intent.EXTRA_BCC, new String[]{});
mailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);
mailIntent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml(emailBody));
startActivity(Intent.createChooser(mailIntent, "You need to configure gmail..."));*
「emailBody」には特別な URL リンクが含まれています: ace:adid=9ca98efe-ef48-47c0-aff5-058224b3093d
When I send this email to others, The recipient open the mail, there is no such a special URL link.
I do not know why ? When I use other email (not gmail) send the same html content, It's ok. the recipient can see the special URL link.