Skip to content

Instantly share code, notes, and snippets.

@hkurosawa
Created March 17, 2012 15:24
Show Gist options
  • Save hkurosawa/2061125 to your computer and use it in GitHub Desktop.
Save hkurosawa/2061125 to your computer and use it in GitHub Desktop.
Checks if the Android Device can handle certain Intent
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