summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/Workspace.java
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2012-06-06 14:10:04 -0700
committerAdam Cohen <adamcohen@google.com>2012-06-06 15:00:45 -0700
commit3d50932a93dd367537db3548bde29d1380b371c0 (patch)
tree28164308e8f356646ddf89296abec14cb1049e49 /src/com/android/launcher2/Workspace.java
parent5b7fcb7a8bee95b5c59dd296c6b022e3d1c55102 (diff)
downloadandroid_packages_apps_Trebuchet-3d50932a93dd367537db3548bde29d1380b371c0.tar.gz
android_packages_apps_Trebuchet-3d50932a93dd367537db3548bde29d1380b371c0.tar.bz2
android_packages_apps_Trebuchet-3d50932a93dd367537db3548bde29d1380b371c0.zip
Fixing ConcurrentModificationException (issue 6619380)
Change-Id: I49d293a79a463d129e829f823d6b213f3d5ffcf4
Diffstat (limited to 'src/com/android/launcher2/Workspace.java')
-rw-r--r--src/com/android/launcher2/Workspace.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index ba518890e..8b9662b3b 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -670,6 +670,29 @@ public class Workspace extends SmoothPagedView
return super.onInterceptTouchEvent(ev);
}
+ protected void reinflateWidgetsIfNecessary() {
+ final int clCount = getChildCount();
+ for (int i = 0; i < clCount; i++) {
+ CellLayout cl = (CellLayout) getChildAt(i);
+ ShortcutAndWidgetContainer swc = cl.getShortcutsAndWidgets();
+ final int itemCount = swc.getChildCount();
+ for (int j = 0; j < itemCount; j++) {
+ View v = swc.getChildAt(j);
+
+ if (v.getTag() instanceof LauncherAppWidgetInfo) {
+ LauncherAppWidgetInfo info = (LauncherAppWidgetInfo) v.getTag();
+ LauncherAppWidgetHostView lahv = (LauncherAppWidgetHostView) info.hostView;
+ if (lahv != null && lahv.orientationChangedSincedInflation()) {
+ mLauncher.removeAppWidget(info);
+ // Remove the current widget which is inflated with the wrong orientation
+ cl.removeView(lahv);
+ mLauncher.bindAppWidget(info);
+ }
+ }
+ }
+ }
+ }
+
@Override
protected void determineScrollingStart(MotionEvent ev) {
if (isSmall()) return;