Android how to get list of apps that open url without using createChooser

To find all applications that open a URL, I would do the following:

    Uri uri = Uri.parse(URL);
    Intent intent = new Intent(Intent.ACTION_VIEW, uri);
    Intent intentChooser = Intent.createChooser(intent,"Choose navigator");
    activity.startActivity(intentChooser);

The problem is that I do not want to use the Chooser control due to some evolving specifications.

The question is, how can I get a list of applications that open the URL (what I get with the code above) to pass them to ArrayAdapter / Spinner.

+3
source share
2 answers

, :

Uri uri = Uri.parse(URL);
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
List<ResolveInfo> allActivities = queryIntentActivities(intent, 0);
0

Source: https://habr.com/ru/post/1777656/


All Articles