0

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;
}
Charuක
  • 12,953
  • 5
  • 50
  • 88
WrapItUp87
  • 290
  • 1
  • 2
  • 15
  • http://stackoverflow.com/questions/10925542/how-to-get-gmail-mails-programmatically-in-android – Charuක Dec 24 '16 at 03:43
  • ^ 1. I don't care about email messages in the emails. 2. I want to see if there are any configured emails and not just gmail on the device. – WrapItUp87 Dec 24 '16 at 04:20

0 Answers0