
我能够使用DevicePolicyManager和getActiveAdmins()激活设备管理员来检索所有应用程序:
final DevicePolicyManager dpm = (DevicePolicyManager) getSystemService(Context.DEVICE_POliCY_SERVICE);final List<Componentname> adminList = dpm.getActiveadmins();for ( Componentname app : adminList ) { Log.d(TAG,"App: ",app.getPackagename());} 但是,为了停用它们,我不能使用removeActiveAdmin(…),因为它不会删除不属于我自己的应用程序的组件.
我正在考虑使用Intent和startActivity()来打开我想要停用的特定组件的设备管理员停用页面.可能吗?
解决方法Is it possible to programmatically deactivate a (third-party) Device administrator app?
不可以.也不可能以编程方式激活一个.
I was thinking to use an Intent and startActivity() in order to open the Device administrator’s deactivation page of that specific component I want to deactivate.
“设置”应用中没有可以直接转到“移除设备管理”屏幕的入口点,更不用说为其记录的Intent *** 作了.您可以通过这种方式添加设备管理员,但不能删除它们.
总结以上是内存溢出为你收集整理的以编程方式停用Android中的Device Admininstrator?全部内容,希望文章能够帮你解决以编程方式停用Android中的Device Admininstrator?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)