I tried using this method to see any emails are available, but I keep getting there are none(false). I even tried using a tablet linked to g mail for this with no luck, further more I also tried switching the action string with Intent.ACTION_SEND
and same result.
I want to get this check to work to for a function I'm working on and please do not recommend the Activity not found exception because I want to alert the user if he has not configured his/her email before I run my email intent not after. Below is the defective email checker.
public static boolean isIntentAvailable(Context context, String action) {
final PackageManager packageManager = context.getPackageManager();
final Intent intent = new Intent(action);
List<ResolveInfo> list =
packageManager.queryIntentActivities(intent,
PackageManager.MATCH_DEFAULT_ONLY);
return list.size() > 0;
}