android - ResolveInfo.loadIcon() causes warning-Spam -


in android application, displaying list of every user-app installed.

everything runs fine, mentioned in below code, calling icon = info.loadicon(context.getpackagemanager()); results in 2 annoying warnings. since loading every app on device, generates huge list of warnings spamming console.

despite warnings, icon loading , displaying fine.

i don't warning comes from. how debug it? alternatively, can 1 disable log-output of specific code line?

here wrapper class:

public class appwrapper {     public final drawable icon;     public final string applabel;     public final string packagename;      public appwrapper(context context, resolveinfo info) {          //warnings produced here:         icon = info.loadicon(context.getpackagemanager());         /*          packagemanager: no package identifier when getting value resource number 0x00000000          resourcetype: failure retrieving resources com.example.app: resource id #0x0          */          applabel = info.loadlabel(context.getpackagemanager()).tostring();         packagename = info.activityinfo.packagename;     } } 

many in advance!

icon = info.loadicon(context.getpackagemanager()); 

instead

icon = context.getpackagemanager().getapplicationicon(info.activityinfo.applicationinfo.packagename); 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -