我正在尝试将数据存储到循环中的 SharedPreference 中,但我收到此错误的结果:
D/SharedPreferencesImpl: Time required to fsync /data/user/0/pacjakename/shared_prefs/shared.xml: [<1: 0, <2: 0, <4: 0, <8: 0, <16: 0, <32: 0, <64: 0, <128: 1, <256: 0, <512: 2, <1024: 0, <2048: 0, <4096: 0, <8192: 0, <16384: 0, >=16384: 0]
以下是我如何存储数据:
public void savePromotions(RequestResponse requestResponse) {
SharedPreferences sharedPreferences = context.getSharedPreferences("promotions", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPreferences.edit();
Gson gson = new Gson();
String json = gson.toJson(requestResponse);
editor.putString("promotions", json).apply();
}
共享首选项是否需要时间来存储数据?
或者这条消息是什么?