Fixing bug 5011917 - clearing refernce to old folders from FolderInfo
-> Also, ensured that unbind() gets called on all ItemInfos on rotate
Change-Id: I869b68fcae5c66702ec204596f5ecabdc7a32df7
diff --git a/src/com/android/launcher2/ItemInfo.java b/src/com/android/launcher2/ItemInfo.java
index 3a1c29a..8d46624 100644
--- a/src/com/android/launcher2/ItemInfo.java
+++ b/src/com/android/launcher2/ItemInfo.java
@@ -144,7 +144,13 @@
values.put(LauncherSettings.Favorites.ICON, data);
}
}
-
+
+ /**
+ * It is very important that sub-classes implement this if they contain any references
+ * to the activity (anything in the view hierarchy etc.). If not, leaks can result since
+ * ItemInfo objects persist across rotation and can hence leak by holding stale references
+ * to the old view hierarchy / activity.
+ */
void unbind() {
}