Reputation: 21
How can I determine what is a default mail client on Adnroid? It could be for example standard Mail app or GMail appliction, how to know which one is configured as default?
Upvotes: 2
Views: 362
Reputation: 1007594
There is no concept of a "default mail client on Android".
There is a concept of a default app for a specific Intent
structure. Hence, an Intent
to send an email (e.g., ACTION_SENDTO
with a mailto:
Uri
) may be tied to a default app. To find out what that default is, create the desired Intent
and use resolveActivity()
on PackageManager
. This will come back with:
null
, if there are no matching activitiesOr, use PackageManager
and getPreferredActivities()
and sift through those for things that you think are mail clients.
Upvotes: 2