“清除用户数据”android

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2196582/
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 04:54:10  来源:igfitidea点击:

"Clear User Data" android

android

提问by Faisal Abid

What exactly does Clear User Data do? I mean I know it clears the users data from the app, but what data being stored where?

清除用户数据究竟有什么作用?我的意思是我知道它会清除应用程序中的用户数据,但是哪些数据存储在何处?

采纳答案by hackbod

This is not a permissions that applications can hold.

这不是应用程序可以拥有的权限。

It is there for the settings app's "Clear data" button in manage applications. It simply erases all of the data in internal storage associated with the app, bringing it back to its initial install state.

它位于管理应用程序中设置应用程序的“清除数据”按钮。它只是擦除与应用程序关联的内部存储中的所有数据,使其恢复到初始安装状态。

回答by Grandpop

This "CLEAR DATA" option is severely broken for the use-case of Home Screen widgets that may have shared preferences and/or some local cached data.

对于可能具有共享首选项和/或某些本地缓存数据的主屏幕小部件的用例,此“清除数据”选项被严重破坏。

It is also completely against the developer documentation which says:

它也完全违反了开发人员文档,其中说:

"You can save files directly on the device's internal storage. By default, files saved to the internal storage are private to your application and other applications cannot access them (nor can the user). When the user uninstalls your application, these files are removed."

“您可以将文件直接保存在设备的内部存储器上。默认情况下,保存到内部存储器的文件对您的应用程序是私有的,其他应用程序无法访问它们(用户也不能)。当用户卸载您的应用程序时,这些文件将被删除.”

It would be good if answers to valid questions actually offered some useful advice, like a work-around or some method that achieves the result being sought by the question.

如果有效问题的答案实际上提供了一些有用的建议,例如解决方法或实现问题所寻求结果的某种方法,那就太好了。

So, what happens to a Home Screen widget that has shared preferences and then the user clears the data? Any useful suggestion how not to break the running code of the widget when it has the data pulled away without any notice?

那么,具有共享首选项然后用户清除数据的主屏幕小部件会发生什么情况?任何有用的建议如何在没有任何通知的情况下将数据拉走时如何不破坏小部件的运行代码?