From ca2484bb0553a93507eccec96cc73ecee1d77a53 Mon Sep 17 00:00:00 2001 From: Scott Warner Date: Sun, 19 Aug 2012 15:09:15 -0400 Subject: Show a Toast on a successful application uninstall Instead of waiting for the user to tap OK, just show a Toast and get out of the way. Does not change anything for unsuccessful uninstall attempts Change-Id: I32c2097405b4c4f514224b7561b83175a1c882fb --- src/com/android/packageinstaller/UninstallAppProgress.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/com/android/packageinstaller/UninstallAppProgress.java b/src/com/android/packageinstaller/UninstallAppProgress.java index 3dfa80f..92822b8 100755 --- a/src/com/android/packageinstaller/UninstallAppProgress.java +++ b/src/com/android/packageinstaller/UninstallAppProgress.java @@ -17,6 +17,7 @@ package com.android.packageinstaller; import android.app.Activity; +import android.content.Context; import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.pm.IPackageDeleteObserver; @@ -31,6 +32,7 @@ import android.view.View.OnClickListener; import android.widget.Button; import android.widget.ProgressBar; import android.widget.TextView; +import android.widget.Toast; /** * This activity corresponds to a download progress screen that is displayed @@ -74,7 +76,11 @@ public class UninstallAppProgress extends Activity implements OnClickListener { switch (msg.arg1) { case PackageManager.DELETE_SUCCEEDED: statusText = R.string.uninstall_done; - break; + // Show a Toast and finish the activity + Context ctx = getBaseContext(); + Toast.makeText(ctx, statusText, Toast.LENGTH_LONG).show(); + setResultAndFinish(mResultCode); + return; case PackageManager.DELETE_FAILED_DEVICE_POLICY_MANAGER: Log.d(TAG, "Uninstall failed because " + packageName + " is a device admin"); -- cgit v1.1