Improve the threading model in the gestures settings activity.
This change checks for isCancelled() inside the loop to be able to terminate
the thread as early as possible.
diff --git a/src/com/android/launcher/GesturesActivity.java b/src/com/android/launcher/GesturesActivity.java
index a112e1b..c936576 100644
--- a/src/com/android/launcher/GesturesActivity.java
+++ b/src/com/android/launcher/GesturesActivity.java
@@ -209,7 +209,7 @@
adapter.sort(mSorter);
checkForEmpty();
adapter.notifyDataSetChanged();
-
+
LauncherModel.deleteGestureFromDatabase(this, info);
Toast.makeText(this, R.string.gestures_delete_success, Toast.LENGTH_SHORT).show();
@@ -239,6 +239,8 @@
final LauncherModel model = Launcher.getModel();
for (String name : store.getGestureEntries()) {
+ if (isCancelled()) break;
+
final Gesture gesture = store.getGestures(name).get(0);
final Bitmap bitmap = gesture.toBitmap(mThumbnailSize, mThumbnailSize,
mThumbnailInset, mPathColor);