OSDN Git Service

Workaround for crashing on rotation. (Bug 6611883)
authorWinson Chung <winsonc@google.com>
Tue, 5 Jun 2012 22:47:30 +0000 (15:47 -0700)
committerWinson Chung <winsonc@google.com>
Tue, 5 Jun 2012 22:47:55 +0000 (15:47 -0700)
Change-Id: Iae24d865fb5a5572c6d3e8726569d234a60ce05c

src/com/android/launcher2/Launcher.java

index 9cae5e5..105d943 100644 (file)
@@ -704,7 +704,8 @@ public final class Launcher extends Activity
                 AppWidgetProviderInfo pInfo = lahv.getAppWidgetInfo();
 
                 // Remove the current widget which is inflated with the wrong orientation
-                getWorkspace().getParentCellLayoutForView(lahv).removeView(lahv);
+                CellLayout cl = getWorkspace().getParentCellLayoutForView(lahv);
+                if (cl != null) cl.removeView(lahv);
                 // Re-inflate the widget using the correct orientation
                 AppWidgetHostView widget = mAppWidgetHost.createView(this, info.appWidgetId, pInfo);