保存EditText并自动检索它 [英] Saving EditText and retrieve it automatically
问题描述
嗨我正在尝试将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屋!