3

My scenario is like this: (1)I found a mail(Gmail) which is very useful. (2)I send the URL of this mail to my app on android. (3)In my app, I launch the Gmail App to display this specific mail. I don't know how to launch the Gmail App to display the URL of this specific mail. Any advice will be appreciated.

Thank you.

2 Answers2

0

I don't think you can open the Gmail app on an specific mail. You can open the app for sure using Intents, but not an specific mail.

svpino
  • 1,864
  • 17
  • 18
  • Actually, I tried to use browser to open the URL of the specific mail, but I can only get into the "inbox". That's why I want to try the Gmail App. – shenhongzhou Nov 03 '11 at 03:18
  • Yes, I tried before, but there's more than that: for something like this to happen, the GMAIL app must support it. The problem is not with Android, but with the GMAIL app. If they don't provide a hook so you can pass a URL and they open that email, there's nothing you can do. – svpino Nov 03 '11 at 17:36
-1

This never was answered so I'll add one:

Intent sendIntent = new Intent(Intent.ACTION_VIEW);
sendIntent.setClassName("com.google.android.gm","com.google.android.gm.ComposeActivityGmail");
sendIntent.putExtra(Intent.EXTRA_EMAIL, new String[] { "abc@gmail.com" });
sendIntent.setData(Uri.parse("abc@gmail.com"));
sendIntent.putExtra(Intent.EXTRA_SUBJECT, "enter subject");
sendIntent.setType("plain/text");
sendIntent.putExtra(Intent.EXTRA_TEXT, "Insert text");
startActivity(sendIntent);

This is from my answer here: Intent URI to launch Gmail App

Community
  • 1
  • 1
Jared Burrows
  • 54,294
  • 25
  • 151
  • 185