From 6419915d5ada26b643324c1ffef219c5a4d4c600 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Sun, 11 May 2014 02:25:50 +0200 Subject: [PATCH] Strings for error dialog, cleanup --- res/values/strings.xml | 4 +++- src/org/fdroid/fdroid/AppDetails.java | 24 ++++++------------------ 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 6bbbcf099..f342e1faf 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -270,5 +270,7 @@ Root access denied Either your Android device is not rooted or you have denied root access for F-Droid. Update all - + (De-)Installation Error + The (de-)installation failed. If you are using root access, try disabling this setting! + diff --git a/src/org/fdroid/fdroid/AppDetails.java b/src/org/fdroid/fdroid/AppDetails.java index 029ae805b..ab0d812e2 100644 --- a/src/org/fdroid/fdroid/AppDetails.java +++ b/src/org/fdroid/fdroid/AppDetails.java @@ -981,26 +981,13 @@ public class AppDetails extends ListActivity { } } - /** - * We could probably drop this, and let the PackageReceiver take care of - * notifications for us, but I don't think the package receiver - * notifications are very instantaneous. - */ - private void notifyAppChanged(String id) { - getContentResolver().notifyChange(AppProvider.getContentUri(id), null); - } - Installer.InstallerCallback myInstallerCallback = new Installer.InstallerCallback() { @Override public void onSuccess(final int operation) { runOnUiThread(new Runnable() { @Override - public void run() { - Log.d(TAG, "handling installer onSuccess"); - - notifyAppChanged(app.id); - + public void run() { if (operation == Installer.InstallerCallback.OPERATION_INSTALL) { if (downloadHandler != null) { downloadHandler = null; @@ -1028,11 +1015,12 @@ public class AppDetails extends ListActivity { @Override public void run() { setProgressBarIndeterminateVisibility(false); - - // TODO + + Log.e(TAG, "Installer aborted with errorCode: " + errorCode); + AlertDialog.Builder alertBuilder = new AlertDialog.Builder(AppDetails.this); - alertBuilder.setTitle("Error"); - alertBuilder.setMessage("errorCode: " + errorCode); + alertBuilder.setTitle(R.string.installer_error_title); + alertBuilder.setMessage(R.string.installer_error_title); alertBuilder.setNeutralButton(android.R.string.ok, null); alertBuilder.create().show(); }