2

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?

4

2 に答える 2

4

2 番目のリンクの回答に示されているものと同様のパターンを使用できるはずです。意図を変更するだけです:

final Intent sendIntent = new Intent(Intent.ACTION_SEND, null);
final List<ResolveInfo> pkgAppsList
    = context.getPackageManager().queryIntentActivities(sendIntent, 0);
于 2013-05-10T17:20:09.653 に答える
1

この回答からこのコードを試すことができます:

    Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
    emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{"xxxxxxxx@gmail.com"});
    emailIntent.setType("plain/text");
    startActivity(Intent.createChooser(emailIntent, "Send email..."));
于 2013-05-10T17:22:22.690 に答える