How Does Dolphin Web Browser Get Notified When It's Being Uninstalled?
Background It might be useful for apps to allow to ask the user to answer why it was decided to uninstall them. The problem It seems that the Dolphin web browser app (and 'everythi
Solution 1:
Maybe the app has a background service which checks the foreground app when it's own onDestroy() callback is fired, and if the foreground app is the uninstalling activity of android Package installer, it launch a new intent for the webpage?
Solution 2:
My guess is that they're using ACTION_PACKAGE_REMOVED. http://developer.android.com/reference/android/content/Intent.html#ACTION_PACKAGE_REMOVED Either that, or Robin Hood and Frei Tuck method, where each one listens to broadcasts events from the other. Just a guess, but will look into it. This might be an option: How can an app detect that it's going to be uninstalled?
Solution 3:
Please try to get the top activity in the task via ActivityManager, and check if it is the uninstall activity.
Core code:
ComponentName topActivity = mActivityManager.getRunningTasks(1).get(0).topActivity;
String packageName = topActivity.getPackageName();
String className = topActivity.getClassName();
Log.v(TAG, "packageName" + packageName);
Log.v(TAG, "className" + className);
if ("com.android.packageinstaller".equals(packageName)
&& "com.android.packageinstaller.UninstallerActivity".equals(className)) {
//Do anything you want here
}
Post a Comment for "How Does Dolphin Web Browser Get Notified When It's Being Uninstalled?"