Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: How to get the native Email clients package name

Tags:

android

email

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..

like image 656
Sudarshan Avatar asked Mar 12 '13 04:03

Sudarshan


1 Answers

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.

like image 160
Karakuri Avatar answered Oct 19 '22 06:10

Karakuri