什么是Android中使用的共享preferences? [英] What is the use of Shared Preferences in Android?

查看:110
本文介绍了什么是Android中使用的共享preferences?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想知道,有什么用共享preferences的Andr​​oid系统。请有人清楚我的疑问。

修改

我可以用它们为宗旨像显示的设置画面的第一次,并设置一些标志,这样的设置画面/活动将不会显示它完成后(在应用程序下次启动时)<? / P>

解决方案

您可以使用共享preferences保存所有的原始数据:布尔型,浮点型,整型,长整型和字符串。这些数据将在整个用户会话持久(即使你的应用程序被杀死)。

更多

I am just wondering, what is the use of shared preferences in Android. Please some one clear my doubt.

EDIT

Can I use them for the purpose like Showing the setup screen for the first time, and setting some flags, so that the setup screen/activity won't be shown after it is completed(on next startup of app)?

解决方案

You can use SharedPreferences to save any primitive data: booleans, floats, ints, longs, and strings. This data will persist across user sessions (even if your application is killed).

Read More

这篇关于什么是Android中使用的共享preferences?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆