Fixing ConcurrentModificationException (issue 6619380)

Change-Id: I49d293a79a463d129e829f823d6b213f3d5ffcf4
This commit is contained in:
Adam Cohen
2012-06-06 14:10:04 -07:00
parent 5b7fcb7a8b
commit 3d50932a93
3 changed files with 24 additions and 34 deletions
+23
View File
@@ -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;