如何在android中让我的应用程序设备管理员?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10994558/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 05:40:57  来源:igfitidea点击:

how to make my application device administrator in android?

androiddevice-admin

提问by rolling.stones

I am trying to make my application device administrator , i followed some notes provided on the same at Device admin SAMPLE notesor TUTORIAL here but still could not implement it.

我正在尝试让我的应用程序设备管理员,我按照设备管理员示例说明教程此处提供的一些说明进行操作, 但仍然无法实现它。

Can some one plz point out a working example of the same , i just need to make sure that to uninstall the application , user needs to enter the password which is set in my application.

有人可以指出一个相同的工作示例吗,我只需要确保要卸载应用程序,用户需要输入在我的应用程序中设置的密码。

Any help will be useful , Thanks in advance

任何帮助都会有用,提前致谢

采纳答案by CommonsWare

i just need to make sure that to uninstall the application , user needs to enter the password which is set in my application.

我只需要确保要卸载应用程序,用户需要输入在我的应用程序中设置的密码。

Fortunately, this is not possible for an SDK application. Even a device admin app cannot prevent the user from uninstalling it.

幸运的是,这对于 SDK 应用程序是不可能的。即使是设备管理应用程序也无法阻止用户卸载它。

回答by Htoo Aung Hlaing

I found the sample tutorial here. I hope it will help you.

我在这里找到了示例教程。我希望它会帮助你。

Warning:::: If you click "Reset Device", your device will be factory reset because of

警告:::: 如果您单击“重置设备”,您的设备将恢复出厂设置,因为

devicePolicyManager.wipeData(ACTIVATION_REQUEST);