Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7911937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:26:16+00:00 2026-06-03T13:26:16+00:00

I am able to get all the applications which are in Launcher with the

  • 0

I am able to get all the applications which are in Launcher with the help of Intent.CATEGORY_LAUNCHER.

So for testing I created a test activity, this activity contains a single button, if I press the button, it should display the applications in the device

NOTE: `it should not display specific. for example i needed only Browser it should display all browser applications.`

I tried in this way a small CODE:

btn.setOnClickListener(new OnClickListener() {

        public void onClick(View v) {
            Intent intent = new Intent(Intent.ACTION_MAIN);
            intent.addCategory(Intent.CATEGORY_APP_BROWSER);

            List<ResolveInfo> mainLauncherList = getPackageManager().queryIntentActivities(intent, 0);
            System.out.println("the list iss = " +mainLauncherList);
        }
    });

The list is returning only one browser that is single Browser.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T13:26:17+00:00Added an answer on June 3, 2026 at 1:26 pm

    Instead of a category, give the intent an action and query the ones that could ACTION_VIEW a url, like so:

    Intent intent = new Intent(Intent.ACTION_VIEW);
    intent.setData(Uri.parse("http://www.google.com"));
    
    List<ResolveInfo> mainLauncherList = getPackageManager().queryIntentActivities(intent, 0);
    Log.e("Browsers","the list iss = " +mainLauncherList);
    

    Which returns something like:

    [ResolveInfo{44e9d350 com.android.browser.BrowserActivity p=0 o=0 m=0x208000}]
    

    And assuming you have more than one browser installed, it will contain them all. Maybe I misunderstood your question but this technically returns the same applications you’d get if you tried launching the intent to open the url.

    As to getting the launcher activity of those applications, since you already know how to get all the main applications and by the code I gave, the one you’re after, you could match the package names (assumably) to find the launcher one (?)

    UPDATE

    ArrayList<String> allLaunchers = new ArrayList<String>();
    
    Intent allApps = new Intent(Intent.ACTION_MAIN);
    List<ResolveInfo> allAppList = getPackageManager().queryIntentActivities(allApps, 0);
    for(int i =0;i<allAppList.size();i++) allLaunchers.add(allAppList.get(i).activityInfo.packageName);
    
    Intent myApps = new Intent(Intent.ACTION_VIEW);
           myApps.setData(Uri.parse("http://www.google.es"));
    List<ResolveInfo> myAppList = getPackageManager().queryIntentActivities(myApps, 0);
    for(int i =0;i<myAppList.size();i++){
        if(allLaunchers.contains(myAppList.get(i).activityInfo.packageName)){
            Log.e("match",myAppList.get(i).activityInfo.packageName+"");
        }
    }
    

    As I was saying, you get all packages, from the launcher and match them against the packages from the ones that are able to perform the action, be it take a photo, or browse the web. You should be able to get that thing going with this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to be able to get all of this information (as text) into
I haven't been able to get this working and all of the sample code
not able to get this, can someone help for this LINQ query? select col1,
Using the Redis info command, I am able to get all the stats of
I want to be able to achieve the following using guice/gin: Get all sort
I would like to be able to get a list of all possible files
Hi all I have sample applications which works on other platforms (from 1.6+) But
First of all (before this question get down voted): I am a developer developing
According to the Grails literature http://grails.org/doc/2.0.x/ref/Domain%20Classes/getAll.html I should be able to do this def
I am able to get the current date, but I don't know how to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.