Is it possible to open an emailclient such as gmail when I click a button in my app?
Step 1: On the home screen, tap on Apps > Settings > Accounts or simply go to Apps > Email to open up the email app. Step 2: Tap on 'Add account' and select the kind of account you want to add, e.g. Email, Google, Personal (IMAP) or Personal (POP3).
1.2. To start an activity, use the method startActivity(intent) . This method is defined on the Context object which Activity extends. The following code demonstrates how you can start another activity via an intent. # Start the activity connect to the # specified class Intent i = new Intent(this, ActivityTwo.
An intent allows you to start an activity in another app by describing a simple action you'd like to perform (such as "view a map" or "take a picture") in an Intent object.
Yes. You can launch it via Intents.
Intent i = new Intent(Intent.ACTION_SEND);
i.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{ emailAddress });
i.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);
i.putExtra(android.content.Intent.EXTRA_TEXT, text);
startActivity(Intent.createChooser(i, "Send email"));
Intent i = new Intent(Intent.ACTION_SENDTO, Uri.fromParts(
"mailto", EMAIL_ADDRESS, null));
up to date way of doing it
i.putExtra(android.content.Intent.EXTRA_SUBJECT, SUBJECT);
i.putExtra(android.content.Intent.EXTRA_TEXT, BODY);
startActivity(Intent.createChooser(i, "Send email"));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With