Created
November 27, 2014 19:06
-
-
Save matthiaswenz/e221fc854e193cc82edd to your computer and use it in GitHub Desktop.
Find apps supporting your URL scheme in Android
This file contains 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
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