I am designing an app in which i need to open an email client on clicking a button. The email client should be opened with a pre-defined subject and \'to\' address. Is there
To show only email clients use this code:
Intent intent = new Intent(Intent.ACTION_VIEW);
Uri data = Uri.parse("mailto:recipient@example.com?subject=" + Uri.encode(subject) + "&body=" + Uri.encode(body));
intent.setData(data);
startActivity(intent);
If you already chose default email client then it will launch it. Otherwise it will show a list of available email clients.