summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Guy <romainguy@android.com>2009-09-29 16:19:19 -0700
committerRomain Guy <romainguy@android.com>2009-09-29 16:19:19 -0700
commit207e40ee66fddded52a028b8f68be3605da3df37 (patch)
treedf856267a0d4dfbc8d34d3692f324303dedeb482
parentdd4a83ed79a7f4a217e222c1a5c3d0c45a539f72 (diff)
downloadpackages_apps_trebuchet-207e40ee66fddded52a028b8f68be3605da3df37.zip
packages_apps_trebuchet-207e40ee66fddded52a028b8f68be3605da3df37.tar.gz
packages_apps_trebuchet-207e40ee66fddded52a028b8f68be3605da3df37.tar.bz2
Prevent crash when dropping an icon.
Change-Id: Ia7313db2437a094c11286edeeaae7b3121a873eb
-rw-r--r--src/com/android/launcher2/Workspace.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index cc09bdb..788915e 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -37,7 +37,6 @@ import android.widget.Scroller;
import android.widget.TextView;
import android.os.Parcelable;
import android.os.Parcel;
-import android.util.Log;
import java.util.ArrayList;
@@ -997,7 +996,7 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag
cellLayout.addView(view, insertAtFirst ? 0 : -1);
view.setOnLongClickListener(mLongClickListener);
if (view instanceof DropTarget) {
- mDragController.addDropTarget((DropTarget)view);
+ mDragController.addDropTarget((DropTarget) view);
}
mTargetCell = estimateDropCell(x, y, 1, 1, view, cellLayout, mTargetCell);
@@ -1092,6 +1091,8 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag
}
public void onDropCompleted(View target, boolean success) {
+ clearVacantCache();
+
if (success){
if (target != this && mDragInfo != null) {
final CellLayout cellLayout = (CellLayout) getChildAt(mDragInfo.screen);
@@ -1099,7 +1100,7 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag
if (mDragInfo.cell instanceof DropTarget) {
mDragController.removeDropTarget((DropTarget)mDragInfo.cell);
}
- final Object tag = mDragInfo.cell.getTag();
+ //final Object tag = mDragInfo.cell.getTag();
}
} else {
if (mDragInfo != null) {