Fix bugs 2218563 and 2176751 - Not properly loading icons, and sometimes marking them as cached when

they're not.
This commit is contained in:
Joe Onorato
2009-10-31 19:50:30 -04:00
parent 3c2f7e105d
commit 6f613d2999
2 changed files with 6 additions and 1 deletions

View File

@@ -17,6 +17,7 @@
package com.android.launcher2;
import android.content.Context;
import android.content.pm.PackageManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -30,9 +31,11 @@ import java.util.ArrayList;
*/
public class ApplicationsAdapter extends ArrayAdapter<ApplicationInfo> {
private final LayoutInflater mInflater;
private final PackageManager mPackageManager;
public ApplicationsAdapter(Context context, ArrayList<ApplicationInfo> apps) {
super(context, 0, apps);
mPackageManager = context.getPackageManager();
mInflater = LayoutInflater.from(context);
}
@@ -44,6 +47,9 @@ public class ApplicationsAdapter extends ArrayAdapter<ApplicationInfo> {
convertView = mInflater.inflate(R.layout.application_boxed, parent, false);
}
if (info.icon == null) {
info.icon = AppInfoCache.getIconDrawable(mPackageManager, info);
}
if (!info.filtered) {
info.icon = Utilities.createIconThumbnail(info.icon, getContext());
info.filtered = true;