Uninstallation password

懵懂的女人 提交于 2019-12-07 09:55:10

问题


I am making one phone security application in android. The point where I stuck is that How to set uninstall password for this app. When application is installed user can set the security password and this password will be used for uninstalling this app. So please someone suggest me how to put code for uninstall event.? Is there any event or service called when apps are going to uninstall.?


回答1:


No, sadly there is no uninstall event that you can catch for your own app.

You can only watch the installation and uninstallation of other apps via the Intent.ACTION_PACKAGE_ADDED (and similar) broadcast(s).




回答2:


Maybe you can use a deamon runing in background, that can intercept the uninstall of you application.

This deamon would be executed when the phone turns on, or when your application is used.

To run an application when booting your phone: http://www.androidcompetencycenter.com/2009/06/start-service-at-boot/

Refer to Intent.ACTION_PACKAGE_ADDED (and similar) broadcast(s) as alextsc said. (sorry cannot add comments)




回答3:


android does not give you freedom to perform code when app is uninstalled.

All the settings and application data is deleted which is set by the applicaion

The only thing that will persist is the data that is written to the SD-Card and the changes to phone settings



来源:https://stackoverflow.com/questions/7039976/uninstallation-password

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!