manju
manju

Reputation: 847

launching email client from my app(android)

hi i have used the following code to launch an email client but it is launching only messaging app...so what should get modified in this code....

Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] {"[email protected]"});
emailIntent.setType("text/plain");
startActivity(Intent.createChooser(emailIntent, "Send a mail ..."));

Upvotes: 2

Views: 2836

Answers (3)

AdityaSetyadi
AdityaSetyadi

Reputation: 161

    Intent intent = getPackageManager().getLaunchIntentForPackage("com.android.email");
    startActivity(intent);

Try this, it works on me.

Upvotes: 1

Prashanth Babu
Prashanth Babu

Reputation: 208

Code snippet looks fine. Try it on an actual device, it should work fine.

Upvotes: 2

Zoombie
Zoombie

Reputation: 3610

first check if your email client is configured.

Upvotes: 0

Related Questions