Created
May 21, 2013 13:54
-
-
Save blork/5619948 to your computer and use it in GitHub Desktop.
Check if an intent is available.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static boolean isIntentAvailable(Context context, Intent intent) { | |
| final PackageManager packageManager = context.getPackageManager(); | |
| List<ResolveInfo> resolveInfo = packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); | |
| if (resolveInfo.size() > 0) { | |
| return true; | |
| } | |
| return false; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment