OSDN Git Service

Add catch for missing app icon resource.
authorKenny Guy <kennyguy@google.com>
Tue, 27 May 2014 15:34:59 +0000 (16:34 +0100)
committerKenny Guy <kennyguy@google.com>
Tue, 27 May 2014 15:34:59 +0000 (16:34 +0100)
The catch was present before moving the code into
the compat class.

Bug: 15276879
Change-Id: I81fbd49dacd813e861a2bc4f0b41dcbeccb9def2

src/com/android/launcher3/compat/LauncherActivityInfoCompatV16.java

index 9b9384d..052d434 100644 (file)
@@ -61,7 +61,11 @@ public class LauncherActivityInfoCompatV16 extends LauncherActivityInfoCompat {
                 resources = null;
             }
             if (resources != null) {
-                d = resources.getDrawableForDensity(mActivityInfo.getIconResource(), density);
+                try {
+                    d = resources.getDrawableForDensity(mActivityInfo.getIconResource(), density);
+                } catch (Resources.NotFoundException e) {
+                    // Return default icon below.
+                }
             }
         }
         if (d == null) {