With Drawable appIcon = (Drawable) packageInfo.applicationInfo.loadIcon (getPackageManager ()); acquired icon, and then rewritten in getview function inside the following procedure
ImageView imageViewIcon = (ImageView) convertView.findViewById (R.id.imageView1);
imageViewIcon.setImageDrawable (appUnit.appIcon);
But has access to less than icon, application version and the name of the program can normally get, is not without adding any authority, or where the wrong<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Please help, be grateful
Reply:
Do you determine the correct packageInfo
Reply:
Correct name, version numbers are normally acquired
Reply:
PackageInfo info = getPackageManager () getPackageArchiveInfo (fullPath, 0);.
ApplicationInfo appinfo = info.applicationInfo;
label = getPackageManager () getApplicationLabel (appinfo) toString ();..
img = getPackageManager () getApplicationIcon (info.packageName).;
Reply:
This sentence Drawable appIcon = (Drawable) packageInfo.applicationInfo.loadIcon (getPackageManager ());'s getPackageManager () method is a local solution? Note pointer problem.
Reply:
Pro-test this method can get to the icon, check the value appUnit.appIcon the landlord.
In this way the landlord can get to all the apk information systems, including not displayed in the launcher. There is a way to just get into one of those launcher apk information:
private ListmApps;
Intent mainIntent = new Intent (Intent.ACTION_MAIN, null);
mainIntent.addCategory (Intent.CATEGORY_LAUNCHER);
mApps = getPackageManager () queryIntentActivities (mainIntent, 0);.
ResolveInfo info = mApps.get (position);
imageViewIcon.setImageDrawable (info.activityInfo.loadIcon (getPackageManager ()));
No comments:
Post a Comment