简体   繁体   English

是否可以使用缓存清除共享首选项?如果是,那么如何清除它?

[英]Is it possible to clear shared preference using cache memory & if yes then how to clear it?

In android, is it possible to delete data in shared preferences by clearing data in cache memory? 在android中,是否可以通过清除缓存中的数据来删除共享首选项中的数据? if yes then what is happens & if not then why? 如果是,那么会发生什么;如果不是,那么为什么?

Clearing an app's cache does not clear the settings. 清除应用程序的缓存不会清除设置。 The settings data (including shared preferences) is stored in a different place than the app's cache. 设置数据(包括共享的首选项)存储在与应用程序缓存不同的位置。 You need to "clear data" to clear out the shared preferences. 您需要“清除数据”以清除共享的首选项。 See this thread , for instance, for more info. 例如,请参阅此线程以获取更多信息。

Using SharedPreferences.Editor clear () and commit() will remove all values from the preferences. 使用SharedPreferences.Editor的clear()和commit()将从首选项中删除所有值。 Do you mean this? 你是这个意思吗

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM