Skip to content Skip to sidebar Skip to footer

Usage Of Application Info , Package Info And Resolve Info

What is the use of Application info and how to use it. I'm confused how to retrieve the installed apps from the device and to display it with logo Can anyone please help me to sort

Solution 1:

to display a list of installed apps, you can try this

finalIntentmainIntent=newIntent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
finalListpkgAppsList= context.getPackageManager().queryIntentActivities( mainIntent, 0);

You will get all the necessary data in the ResolveInfo to start a application. You can check ResolveInfo

or try this code

PackageManagerpm=this.getPackageManager();

    Intentintent=newIntent(Intent.ACTION_MAIN, null);
    intent.addCategory(Intent.CATEGORY_LAUNCHER);

    ArrayList<ResolveInfo> list = (ArrayList<ResolveInfo>) 
        pm.queryIntentActivities(intent, PackageManager.PERMISSION_GRANTED);
        for (ResolveInfo rInfo : list) {
        System.out.println("Installed Applications " + rInfo.activityInfo.applicationInfo.loadLabel(pm).toString());
        }

Post a Comment for "Usage Of Application Info , Package Info And Resolve Info"