Fixing issue where multiple widget pages would fail to load correctly, preventing you from adding widgets. (Bug 6556434)
Change-Id: I48a8aa51d892aef7036009a608903fe089136d82
diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java
index 67def17..03d2a72 100644
--- a/src/com/android/launcher2/AppsCustomizePagedView.java
+++ b/src/com/android/launcher2/AppsCustomizePagedView.java
@@ -974,6 +974,12 @@
task.cancel(false);
iter.remove();
mDirtyPageContent.set(task.page, true);
+
+ // We've already preallocated the views for the data to load into, so clear them as well
+ View v = getPageAt(task.page);
+ if (v instanceof PagedViewGridLayout) {
+ ((PagedViewGridLayout) v).removeAllViewsOnPage();
+ }
}
mDeferredSyncWidgetPageItems.clear();
}