Android: how to get the name package of mail client names

On Samsung devices, com.sec.android.email is the default built-in email client, but on HTC it is com.htc.android.mail . My question is, is there a way to get the default email client name on an Android device, regardless of different company builds.

+5
source share
1 answer

This is not a complete answer, but here's how to get a list of operations that can send message/rfc822:

Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("message/rfc822");
PackageManager pkgManager = context.getPackageManager();
List<ResolveInfo> activities = pkgManager.queryIntentActivities(intent, 0);

You can iterate over the list. See ResolveInfodocumentation for areas of interest.

+3
source

All Articles