如何禁用“管理应用程序"的“应用程序信息"中的“清除数据"按钮 [英] How to disable the Clear Data button in Application info of Manage application

查看:76
本文介绍了如何禁用“管理应用程序"的“应用程序信息"中的“清除数据"按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用android 2.2,在android manifest的应用程序"选项卡中提供允许清除数据"选项以设置true或false.但是将其设置为False后,我的应用程序无法在管理"应用程序的应用程序信息中禁用清除数据"按钮.当应用程序在Data/Data/packge-name/databases/中包含数据库时,我遇到了这个问题.

I am working on android 2.2, In a Application tab of android manifest provide the option of "Allow clear data" to set true or false. But after setting it to False, my application can't disable the button of Clear data in application info of Manage application. I am facing this problem when application contains database in Data/Data/packge-name/databases/.

我必须保护我的应用程序数据库免受用户侵害.

I have to protect my application database from user.

推荐答案

无法阻止用户清除您的应用数据.您提到的清单选项仅适用于系统应用程序,作为开发人员,您无法安装系统应用程序.

There is no way to prevent the user from clearing your app data. The manifest option you mention is intended for system apps only and you, as a developer, have no way to install system apps.

请参阅此讨论详细信息-特别是Diane Hackborn(Android框架工程师)的回复

Please see this discussion for details - particularly this response from Diane Hackborn (Android framework engineer)

这篇关于如何禁用“管理应用程序"的“应用程序信息"中的“清除数据"按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆