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 9135489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:49:52+00:00 2026-06-17T08:49:52+00:00

Did my search on the Stackoverflow and Google before already but I could not

  • 0

Did my search on the Stackoverflow and Google before already but I could not find any answer that worked out for me as I get errors when using them or that there are certain codes/parts missing or, that there could be a need to install additional library files.

So basically what I want to do is to retrieve all the installed apps in the android phone and display it out but I have no clue as to how to go about doing it. I usually run into error regarding the “context” variable or that my xml files does not match the .java files in one way or another.

Would anyone be kind enough to give me the source codes for all the required files(e.g. xml, java, manifest, drawable, layout etc) in order to achieve the objective of retrieving all android apps? Help would be very much appreciated

  • 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-17T08:49:52+00:00Added an answer on June 17, 2026 at 8:49 am

    First create main.xml file as follows,

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" >
    
                <ListView
                    android:id="@+id/list1"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content" >
                </ListView>
    
    </LinearLayout>
    

    This list will be used to populate the installed applications,

    Now create the Activity class to fetch the installed applications,

    public class AppList extends Activity {
        private ListView lView;
        private ArrayList results;
        List<ResolveInfo> list;
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
                results = new ArrayList();
            lView = (ListView) findViewById(R.id.list1);
            PackageManager pm = this.getPackageManager();
    
            Intent intent = new Intent(Intent.ACTION_MAIN, null);
            intent.addCategory(Intent.CATEGORY_LAUNCHER);
    
            list = pm.queryIntentActivities(intent,
                PackageManager.PERMISSION_GRANTED);
            for (ResolveInfo rInfo : list) {
                results.add(rInfo.activityInfo.applicationInfo.loadLabel(pm)
                        .toString());
                Log.w("Installed Applications", rInfo.activityInfo.applicationInfo
                        .loadLabel(pm).toString());
            }
            lView.setAdapter(new ArrayAdapter(this,
                    android.R.layout.simple_list_item_1, results));
        }
    }
    

    Edit- If you want to open the application from the list, once you click it. You have to override the onItemClick method of the ListView and in that method, you have to pass the intent to open the selected application.

    Have a look here,

    • Launch an Application from Another Application
    • How to get a list of installed android applications and pick one to run

    These will most probably solve your issue.

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

Sidebar

Related Questions

I already did a search on Google and Stackoverflow, but I couldn't find any
First of all, I did some search and no answer on stackoverflow/google provided me
Please note that this is not homework and i did search before starting this
I did a lot search already but couldn't find a straight anwser. I have
I did search for this topic, but I didn't find any relevant clue for
I did search the forum and did not find a similar question. I'm looking
just to put it out there -I really did search and try to find
I did a search before asking so please don't tell me to do that.
So a search on google didn't turn up anything and neither did StackOverflow so
Ok guys, i've search in google and here in stackoverflow for this answer and

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.