From 4fef50e7f23b2689491231ba2ccc2ac5fb310ea1 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 24 Dec 2014 22:05:14 +0100 Subject: [PATCH] Better Andy ;-) Refs #2095 --- src/biz/bokhorst/xprivacy/ActivityMain.java | 6 +----- src/biz/bokhorst/xprivacy/ApplicationInfoEx.java | 2 ++ 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/biz/bokhorst/xprivacy/ActivityMain.java b/src/biz/bokhorst/xprivacy/ActivityMain.java index 607838952..8edf51d08 100644 --- a/src/biz/bokhorst/xprivacy/ActivityMain.java +++ b/src/biz/bokhorst/xprivacy/ActivityMain.java @@ -1988,11 +1988,7 @@ else if (state == ApplicationInfoEx.STATE_SHARED) getThemed(R.attr.color_state_restricted))); // Display icon - Bitmap bm = xAppInfo.getIconBitmap(ActivityMain.this); - if (bm == null) - holder.imgIcon.setImageDrawable(xAppInfo.getIcon(ActivityMain.this)); - else - holder.imgIcon.setImageBitmap(bm); + holder.imgIcon.setImageBitmap(xAppInfo.getIconBitmap(ActivityMain.this)); holder.imgIcon.setVisibility(View.VISIBLE); // Display on demand diff --git a/src/biz/bokhorst/xprivacy/ApplicationInfoEx.java b/src/biz/bokhorst/xprivacy/ApplicationInfoEx.java index 52b276ae0..519d7ef75 100644 --- a/src/biz/bokhorst/xprivacy/ApplicationInfoEx.java +++ b/src/biz/bokhorst/xprivacy/ApplicationInfoEx.java @@ -164,6 +164,8 @@ public Bitmap getIconBitmap(Context context) { if (mMapAppInfo.size() > 0) { try { final ApplicationInfo appInfo = mMapAppInfo.firstEntry().getValue(); + if (appInfo.icon == 0) + appInfo.icon = android.R.drawable.sym_def_app_icon; final Resources resources = context.getPackageManager().getResourcesForApplication(appInfo); final BitmapFactory.Options options = new BitmapFactory.Options();