From e314ca021418add1917a49ed647fa11bae348025 Mon Sep 17 00:00:00 2001 From: Arne Jans Date: Sat, 15 Oct 2011 00:48:27 +0200 Subject: [PATCH] Potential fix for fb-77 as I cant reproduce this bug. Please get feedback with a testversion if possible and adequate. --- .../todoroo/astrid/core/OldTaskPreferences.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/astrid/plugin-src/com/todoroo/astrid/core/OldTaskPreferences.java b/astrid/plugin-src/com/todoroo/astrid/core/OldTaskPreferences.java index ae861984d..9e639f044 100644 --- a/astrid/plugin-src/com/todoroo/astrid/core/OldTaskPreferences.java +++ b/astrid/plugin-src/com/todoroo/astrid/core/OldTaskPreferences.java @@ -36,6 +36,8 @@ public class OldTaskPreferences extends TodorooPreferenceActivity { @Autowired private TaskService taskService; @Autowired private MetadataService metadataService; + ProgressDialog pd; + @Override public int getPreferenceResource() { return R.xml.preferences_oldtasks; @@ -65,6 +67,17 @@ public class OldTaskPreferences extends TodorooPreferenceActivity { }); } + /* (non-Javadoc) + * @see android.app.Activity#onPause() + */ + @Override + protected void onPause() { + if (pd != null) + pd.dismiss(); + + super.onPause(); + } + /** Show the dialog to delete completed tasks */ private void showDeleteCompletedDialog() { DialogUtilities.okCancelDialog( @@ -142,7 +155,7 @@ public class OldTaskPreferences extends TodorooPreferenceActivity { /** Run runnable with progress dialog */ protected void runWithDialog(final Runnable runnable) { - final ProgressDialog pd = DialogUtilities.progressDialog(this, getString(R.string.DLG_please_wait)); + pd = DialogUtilities.progressDialog(this, getString(R.string.DLG_please_wait)); new Thread(new Runnable() { @Override public void run() {