Skip to content

Instantly share code, notes, and snippets.

@matthiaswenz
Created November 27, 2014 19:06
Show Gist options
  • Save matthiaswenz/e221fc854e193cc82edd to your computer and use it in GitHub Desktop.
Save matthiaswenz/e221fc854e193cc82edd to your computer and use it in GitHub Desktop.
Find apps supporting your URL scheme in Android
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData("mycustomscheme://test");
PackageManager manager = context.getPackageManager();
List<ResolveInfo> resolvedActivites = manager.queryIntentActivities(i, PackageManager.MATCH_DEFAULT_ONLY);
if (!resolvedActivities.isEmpty()) {
// ... someone responds to the scheme
} else {
// ... nobody does
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment