From 9a73226c5d6769ca7ac50e72a5585f65a6bdc086 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Reimar=20D=C3=B6ffinger?= Date: Sun, 27 Sep 2015 18:15:46 +0200 Subject: [PATCH] Clean up error messaging. Do not show error messages as Toast but Alerts. Also add a button to error message. --- .../android/dictionary/DictionaryManagerActivity.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/com/hughes/android/dictionary/DictionaryManagerActivity.java b/src/com/hughes/android/dictionary/DictionaryManagerActivity.java index 42a9930..d9b1eed 100644 --- a/src/com/hughes/android/dictionary/DictionaryManagerActivity.java +++ b/src/com/hughes/android/dictionary/DictionaryManagerActivity.java @@ -146,8 +146,7 @@ public class DictionaryManagerActivity extends ActionBarActivity { "Download failed: status=" + status + ", reason=" + cursor.getString(cursor .getColumnIndex(DownloadManager.COLUMN_REASON))); - Toast.makeText(context, getString(R.string.downloadFailed, dest), - Toast.LENGTH_LONG).show(); + new AlertDialog.Builder(context).setTitle(getString(R.string.error)).setMessage(getString(R.string.downloadFailed, dest)).setNeutralButton("Close", null).show(); return; } @@ -174,8 +173,7 @@ public class DictionaryManagerActivity extends ActionBarActivity { Toast.makeText(context, getString(R.string.installationFinished, dest), Toast.LENGTH_LONG).show(); } catch (Exception e) { - Toast.makeText(context, getString(R.string.unzippingFailed, dest), - Toast.LENGTH_LONG).show(); + new AlertDialog.Builder(context).setTitle(getString(R.string.error)).setMessage(getString(R.string.unzippingFailed, dest)).setNeutralButton("Close", null).show(); Log.e(LOG, "Failed to unzip.", e); } finally { localZipFile.delete(); @@ -249,6 +247,7 @@ public class DictionaryManagerActivity extends ActionBarActivity { R.string.unableToReadDictionaryDir, dictDir.getAbsolutePath(), Environment.getExternalStorageDirectory())); + builder.setNeutralButton("Close", null); builder.create().show(); } -- 2.43.0