9
在我当前的Android应用程序中,我有几个存储在SharedPreferences中的设置和一个处理对它们的访问的对象。我现在不知道是否是有意义的缓存值,或者如果没有母校多少访问他们喜欢:中SharedPreferences的缓存值是否有意义?
public final boolean isxxxEnabled() {
return preferences.getBoolean("xxx", false);
}
代替
public final boolean isxxxEnabled() {
// check if value changed
// if not, check if value is cached
// decide whether to return cached or new
// cache value
return
}
你有这方面的消息吗? – EmmanuelMess
好的,[这里](https://stackoverflow.com/a/34684174/3124150)是一个参考。 – EmmanuelMess