安卓的EditText始终记得输入的文本 [英] Android: EditText always remembers inputted Text

查看:161
本文介绍了安卓的EditText始终记得输入的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个EditText字段和活动内的复选框。我要的是,每当复选框被选中,在现场的EditText里面输入的文本将被保存,每次用户打开应用程序时,他/她进入最后时刻的文本仍然存在。

I have an EditText field and a check box inside an activity. What I want is, whenever the checkbox is checked, the inputted text inside the EditText field will be saved and everytime the user opens the app, the text he/she enters the last time are still there.

我怎么能执行?

推荐答案

您想要使用的共享preferences

粗略地说,它是你想通过你的应用程序记住简单的原始对象的非分贝存储。

Roughly, it's a non-db storage of simple primitive objects that you want remembered by your application.

这篇关于安卓的EditText始终记得输入的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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