Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我只是想知道,如果我想重置与 SharedPreferences 一起使用的实际首选项文件,我可以重命名首选项文件吗?,这是否意味着该文件仍然存在或覆盖它?
prefs.edit().clear().commit(); // prefs = SharedPreferences
是正确的方法。删除没有引用SharedPreferences对象的文件应该会产生相同的结果。
SharedPreferences