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