IntentのACTION_SENDTOを使用します。
メールアプリ起動サンプル
public void sendMail(Context ctx, String address, String subject, String content) {
Uri uri = Uri.parse("mailto:" + address);
// ACTION_SENDTOを使用してIntentを生成
Intent intent = new Intent(Intent.ACTION_SENDTO, uri);
// タイトルを設定
intent.putExtra(Intent.EXTRA_SUBJECT, subject);
// 本文をを設定
intent.putExtra(Intent.EXTRA_TEXT, content);
// メーラー呼び出し
ct.startActivity(intent);
}
0 件のコメント:
コメントを投稿