Skip to content

Instantly share code, notes, and snippets.

@JEuler
Created November 11, 2017 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JEuler/3f6e51e1c940a0a84f64f3c323e62f2d to your computer and use it in GitHub Desktop.
Save JEuler/3f6e51e1c940a0a84f64f3c323e62f2d to your computer and use it in GitHub Desktop.
isIntentAvailable()
// check intent for run
public boolean isIntentAvailable(Intent intent) {
PackageManager packageManager = getPackageManager();
List<ResolveInfo> activities = packageManager.queryIntentActivities(intent, 0);
return activities.size() > 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment