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

  • Home
  • SEARCH
  • 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 9108089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T02:43:47+00:00 2026-06-17T02:43:47+00:00

First, I would like to say this is my first post on StackOverflow, so

  • 0

First, I would like to say this is my first post on StackOverflow, so I hope I am doing this right.

I am attempting to make an Android App that displays all of a user’s apps. The issue that I’m having is that some apps are being shown multiple times. I do not know how to check the activities associated with the package, but I think it is a similar situation to this:

Android: How to get a list of installed activities, as they appear in launcher, without duplicates

The Intent Solution does not display any duplicates, but how would I use something similar to show in a GridView?

EDIT: Thank you for your quick response. This is the way that I already get the packages. I was not using the 0 flag, however. After substituting the 0 flag in, I still received duplicates. Is it something to do with the way GridView’s work? I happen to notice that when I scroll down on the grid view and go back up, my list is in a different order.

CODE FOR PULLING THE APPS INTO A LIST:

ArrayList<ApplicationInfo> apps =  (ArrayList<ApplicationInfo>) manager.getInstalledApplications(0);  //manager is a variable containing getPackageManager

EDIT 2:

After using the following code to output the ArrayList:

 for(int i = 0; i < apps.size(); i++){

        Log.i((String) apps.get(i).loadLabel(manager), apps.get(i).packageName);

    }

I am able to conclude that there are no duplicates in the array. However, they somehow appear in the gridview.

FINAL EDIT:

The top answer on this question ended up solving the GridView issue:

Items inside GridView getting repeated when screen scrolls

  • 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-17T02:43:48+00:00Added an answer on June 17, 2026 at 2:43 am

    Here is an alternate method for getting currently installed packages. I don’t get duplicates when I grab the info this way:

                PackageManager packageManager = null;
                List<ApplicationInfo> appsList = new ArrayList<ApplicationInfo>();
                try {
                    packageManager = getPackageManager();
                    if (packageManager != null) {
                        appsList = packageManager.getInstalledApplications(0);
                    }
                } catch (Exception e1) {
                    Log.v("TAG", "This is my error: ", e1);
                }
    

    You can then retreive a variety of info from the ApplicationInfo object (including icon, name, etc).

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

Sidebar

Related Questions

First off I would like to say that this is my first post and
First I would like to say that I am new to this site, never
First off I would like to say that I think that my question may
first of all i would like to say i know its probably an easy
Please take a look at this screenshot first: I would like to move the
I would first like to admit that I am an extremely novice developer, so
Right first of I would like to thank everyone for helping me out on
This is my first post to stackoverflow, so if this isn't the correct area
I would first want to say that I am very new to javascript and
This is going to be a long post. I would like to have suggestions

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.