如何海豚的网页浏览器得到通知时,它被卸载?海豚、网页浏览器、通知

由网友(无法言说的痛)分享简介:这可能是有用的应用程序,以允许要求用户回答为什么就决定将其卸载。It might be useful for apps to allow to ask the user to answer why it was decided to uninstall them.看来,海豚的网页浏览器应用程序(和的我的一切发射 )...

这可能是有用的应用程序,以允许要求用户回答为什么就决定将其卸载。

It might be useful for apps to allow to ask the user to answer why it was decided to uninstall them.

看来,海豚的网页浏览器应用程序(和的我的一切发射 )以某种方式设法绕过它,现在它显示了一个网页(在默认Web浏览器)应用程序正在卸载各一次。

It seems that the Dolphin web browser app (and "everything me launcher") somehow managed to bypass it, and now it shows a webpage (on the default web browser) each time the app is being uninstalled.

这是即使我卸载使用亚行。

This happens even if I uninstall using ADB.

作为一个用户,我真的很讨厌它,但它仍然是有趣,因为据我所知,应用程序无法获得意图为自己的卸载。

As a user, I really hate it, but it's still interesting since as far as I know, apps can't get intents for the uninstallation of themselves.

这怎么可能?他们是怎么克服的?

How could it be? How did they manage to overcome this?

这是一个黑客?

推荐答案

请尝试在通过ActivityManager任务在顶,并检查它是否卸载活动。

Please try to get the top activity in the task via ActivityManager, and check if it is the uninstall activity.

核心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
}
阅读全文

相关推荐

最新文章