When closing a folder, make sure to remove it from the list of drop targets.
This fixes the following bugs: 2222908 2208857
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 6fb8e4c..533222d 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -202,6 +202,7 @@
super.onCreate(savedInstanceState);
mModel = ((LauncherApplication)getApplication()).setLauncher(this);
+ mDragController = new DragController(this);
mInflater = getLayoutInflater();
mAppWidgetManager = AppWidgetManager.getInstance(this);
@@ -523,7 +524,6 @@
* Finds all the views we need and configure them properly.
*/
private void setupViews() {
- mDragController = new DragController(this);
DragController dragController = mDragController;
DragLayer dragLayer = (DragLayer) findViewById(R.id.drag_layer);
@@ -1318,8 +1318,7 @@
ViewGroup parent = (ViewGroup) folder.getParent();
if (parent != null) {
parent.removeView(folder);
- // TODO: this line crashes.
- //mDragController.removeDropTarget((DropTarget)folder);
+ mDragController.removeDropTarget((DropTarget)folder);
}
folder.onClose();
}