Created
March 17, 2012 15:24
-
-
Save hkurosawa/2061125 to your computer and use it in GitHub Desktop.
Checks if the Android Device can handle certain Intent
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 boolean canRespondToIntent(Context ctx, Intent i) { | |
PackageManager pm = ctx.getPackageManager(); | |
List<ResolveInfo> l = pm.queryIntentActivities(i, PackageManager.MATCH_DEFAULT_ONLY); | |
if (l.size()>0) { | |
return true; | |
} else { | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment