Sign in to follow this  
Followers 0
timcph2008

Question about list of Installed application in Android phone.

2 posts in this topic

Hi guys,

I wanna create a list of the installed application for practice.

the following code is from another post: https://buckysroom.org/forum/topic.php?id=503
I used the code that they suggest, but there has some errors.
app cannot be resolved to a variable
pm cannot be resolved
apps cannot be resolved to a variable
How should I change it?
Also, what the pm and apps are in the apps?
Thank you so much for your help!!
List<ApplicationInfo> installedApps = new ArrayList<ApplicationInfo>(); for(ApplicationInfo app : apps) {    //checks for flags; if flagged, check if updated system app    if((app.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) == 1) {        installedApps.add(app);    //it's a system app, not interested    } else if ((app.flags & ApplicationInfo.FLAG_SYSTEM) == 1) {        //Discard this one    //in this case, it should be a user-installed app    } else {        installedApps.add(app);    }} String label = (String)pm.getApplicationLabel(app);Drawable icon = pm.getApplicationIcon(app);

 

Share this post


Link to post
Share on other sites

Is that all the code you have? Those error messages mean that you are using variables that don't exist.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0