diff options
| author | Samuel Tardieu <sam@rfc1149.net> | 2011-10-22 15:41:30 +0200 |
|---|---|---|
| committer | Samuel Tardieu <sam@rfc1149.net> | 2011-10-24 23:52:44 +0200 |
| commit | c165e77c4975ca58a211f29b09c209f6eeea1a1b (patch) | |
| tree | c794fd1c282218b8cfb15d69de4bbdef972586b6 /main/src/cgeo/geocaching/activity | |
| parent | 3bec4991410eabe8d8c80c214e30c149bb6bee3d (diff) | |
| download | cgeo-c165e77c4975ca58a211f29b09c209f6eeea1a1b.zip cgeo-c165e77c4975ca58a211f29b09c209f6eeea1a1b.tar.gz cgeo-c165e77c4975ca58a211f29b09c209f6eeea1a1b.tar.bz2 | |
Use a cancellable handler when loading, storing and refreshing caches
This closes #685.
Diffstat (limited to 'main/src/cgeo/geocaching/activity')
| -rw-r--r-- | main/src/cgeo/geocaching/activity/Progress.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/activity/Progress.java b/main/src/cgeo/geocaching/activity/Progress.java index ddb98b2..6edf23e 100644 --- a/main/src/cgeo/geocaching/activity/Progress.java +++ b/main/src/cgeo/geocaching/activity/Progress.java @@ -2,6 +2,7 @@ package cgeo.geocaching.activity; import android.app.ProgressDialog; import android.content.Context; +import android.os.Message; /** * progress dialog wrapper for easier management of resources @@ -17,9 +18,12 @@ public class Progress { dialog = null; } - public synchronized void show(Context context, String title, String message, boolean indeterminate, boolean cancelable) { + public synchronized void show(final Context context, final String title, final String message, final boolean indeterminate, final Message cancelMessage) { if (dialog == null) { - dialog = ProgressDialog.show(context, title, message, indeterminate, cancelable); + dialog = ProgressDialog.show(context, title, message, indeterminate, cancelMessage != null); + if (cancelMessage != null) { + dialog.setCancelMessage(cancelMessage); + } } } |
