Reputation: 1291
In Samsung devices com.sec.android.email is the default In-Built Mail client, but in HTC it is com.htc.android.mail.. My question is is there any way to get the default mail client package name in android device irrespective of the different company builds..
Upvotes: 6
Views: 6809
Reputation: 38605
This isn't a complete answer, but here is how to get a list of Activities 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 ResolveInfo
documentation for fields of interest.
Upvotes: 4