Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SharedPreferences写入有时候没有生效 #12

Open
LinkZhang opened this issue Dec 12, 2018 · 3 comments
Open

SharedPreferences写入有时候没有生效 #12

LinkZhang opened this issue Dec 12, 2018 · 3 comments

Comments

@LinkZhang
Copy link

发现有的手机环境切换没有生效,后来发现SharedPreferences的写入操作用的是apply(),这个方法是异步的,所有存在写入没有完成,就回调onEnvironmentChange方法,建议改成commit()方法,执行成功再回调

@CodeXiaoMai
Copy link
Owner

我在下个版本改一下

CodeXiaoMai added a commit that referenced this issue Dec 12, 2018
@CodeXiaoMai
Copy link
Owner

问题已经修复,请使用最新版本

@LinkZhang
Copy link
Author

commit()有返回值,判断下返回值比较好

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants