0

How to show mail apps through intent. I want to take user to only login screen not to compose email screen

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(resetEmail));
startActivity(intent);

The above code am using for open mail app through intent, but its not working.

Dhruv
  • 1,862
  • 3
  • 20
  • 38
venkatesh gowda
  • 841
  • 2
  • 12
  • 26

4 Answers4

1

Try with this :

    Intent mailer = new Intent(Intent.ACTION_SEND);
    mailer.setType("text/plain");
    mailer.putExtra(Intent.EXTRA_EMAIL, new String[]{"targetMail@gmail.com"});
    mailer.putExtra(Intent.EXTRA_SUBJECT, "SomeSubject");
    mailer.putExtra(Intent.EXTRA_TEXT, "SomeText");
    try {
        startActivity(Intent.createChooser(mailer, "Send to...));
    } catch (Exception e) { }
Lubomir Babev
  • 1,892
  • 1
  • 12
  • 14
0

no.1

 Intent intent= getPackageManager().getLaunchIntentForPackage("com.joyodream.jiji");
             startActivity(intent);

no.2

Intent intent = new Intent();
intent.setAction("com.joyodream.jiji.main");
MainActivity.this.startActivity(intent);

<intent-filter>
<action android:name="com.joyodream.jiji.main" />
<category android:name="android.intent.category.DEFAULT" />               
</intent-filter>
Cgx
  • 753
  • 3
  • 6
0

intent.setType("message/rfc822");

this will show you all mail apps

Neel
  • 77
  • 7
0

Example code:

public void composeEmail(String[] addresses, String subject, String message) {
    Intent intent = new Intent(Intent.ACTION_SENDTO);
    intent.setData(Uri.parse("mailto:"));
    intent.putExtra(Intent.EXTRA_EMAIL, addresses);
    intent.putExtra(Intent.EXTRA_SUBJECT, subject);
    intent.putExtra(Intent.EXTRA_TEXT,message);

    if (intent.resolveActivity(getPackageManager()) != null) {
        startActivity(intent);
    }
}

Refer to this link for more info

Arshak
  • 3,197
  • 1
  • 25
  • 33