Kristy Welsh
Kristy Welsh

Reputation: 8362

How to get list of installed email programs on android

I'm writing an Android app that emails reports to the user. I've seen apps that launch a list of other installed apps that can be used to send email and I am wondering how to do that.

I've looked at this code and this question.

How would you filter out from the list of installed apps to know which ones are used for email?

Upvotes: 2

Views: 1202

Answers (2)

Ted Hopp
Ted Hopp

Reputation: 234847

You should be able use a similar pattern to the one shown in the answer in your second link. You just need to change the intent:

final Intent sendIntent = new Intent(Intent.ACTION_SEND, null);
final List<ResolveInfo> pkgAppsList
    = context.getPackageManager().queryIntentActivities(sendIntent, 0);

Upvotes: 5

antlersoft
antlersoft

Reputation: 14751

You might try this code from this answer:

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

Upvotes: 2

Related Questions