保存 EditText 并自动检索它 [英] Saving EditText and retrieve it automatically

查看:26
本文介绍了保存 EditText 并自动检索它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在尝试将 EditText 小部件值保存在手机/平板电脑的内部存储器中,以便应用程序关闭或活动停止时可以自动检索它们.所有这些都将使用保存按钮工作.(小部件的值由用户输入).

hi I'm trying to save the EditText widget values in the internal memory of the phone/tablet so that they can be retrieved automatically by the app when it closes or the activity stops. All off this will work using a save button.(The values of the widget are inputed by the user).

推荐答案

你应该使用共享首选项,共享首选项用于将数据存储在本地应用程序中,你可以随时访问它.使用此链接 https://www.journaldev.com/9412/android-shared-preferences-example-tutorial

You should use the shared preference ,shared preference is used to store the data in locally app whenever need you can access it . use this link https://www.journaldev.com/9412/android-shared-preferences-example-tutorial

使用它.单击按钮后,您可以获得值.它对我有帮助

to use it. after on button click you can get the value . its help me

这篇关于保存 EditText 并自动检索它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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