Strings for error dialog, cleanup
This commit is contained in:
parent
df696ed81e
commit
6419915d5a
@ -270,5 +270,7 @@
|
|||||||
<string name="root_access_denied_title">Root access denied</string>
|
<string name="root_access_denied_title">Root access denied</string>
|
||||||
<string name="root_access_denied_body">Either your Android device is not rooted or you have denied root access for F-Droid.</string>
|
<string name="root_access_denied_body">Either your Android device is not rooted or you have denied root access for F-Droid.</string>
|
||||||
<string name="update_all">Update all</string>
|
<string name="update_all">Update all</string>
|
||||||
|
<string name="installer_error_title">(De-)Installation Error</string>
|
||||||
|
<string name="installer_error_body">The (de-)installation failed. If you are using root access, try disabling this setting!</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -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() {
|
Installer.InstallerCallback myInstallerCallback = new Installer.InstallerCallback() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(final int operation) {
|
public void onSuccess(final int operation) {
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Log.d(TAG, "handling installer onSuccess");
|
|
||||||
|
|
||||||
notifyAppChanged(app.id);
|
|
||||||
|
|
||||||
if (operation == Installer.InstallerCallback.OPERATION_INSTALL) {
|
if (operation == Installer.InstallerCallback.OPERATION_INSTALL) {
|
||||||
if (downloadHandler != null) {
|
if (downloadHandler != null) {
|
||||||
downloadHandler = null;
|
downloadHandler = null;
|
||||||
@ -1028,11 +1015,12 @@ public class AppDetails extends ListActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
setProgressBarIndeterminateVisibility(false);
|
setProgressBarIndeterminateVisibility(false);
|
||||||
|
|
||||||
// TODO
|
Log.e(TAG, "Installer aborted with errorCode: " + errorCode);
|
||||||
|
|
||||||
AlertDialog.Builder alertBuilder = new AlertDialog.Builder(AppDetails.this);
|
AlertDialog.Builder alertBuilder = new AlertDialog.Builder(AppDetails.this);
|
||||||
alertBuilder.setTitle("Error");
|
alertBuilder.setTitle(R.string.installer_error_title);
|
||||||
alertBuilder.setMessage("errorCode: " + errorCode);
|
alertBuilder.setMessage(R.string.installer_error_title);
|
||||||
alertBuilder.setNeutralButton(android.R.string.ok, null);
|
alertBuilder.setNeutralButton(android.R.string.ok, null);
|
||||||
alertBuilder.create().show();
|
alertBuilder.create().show();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user