Android_非UI:数据存储

来源:互联网 发布:请州长夫人演唱 知乎 编辑:程序博客网 时间:2024/05/12 10:30

SharedPreferences

commit()apply()的区别?

commit()是同步,apply()是异步

Consider using apply() instead; commit writes its data to persistent storage immediately,whereas apply will handle it in the background。