Reputation: 847
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
Reputation: 161
Intent intent = getPackageManager().getLaunchIntentForPackage("com.android.email");
startActivity(intent);
Try this, it works on me.
Upvotes: 1
Reputation: 208
Code snippet looks fine. Try it on an actual device, it should work fine.
Upvotes: 2