开发者

Retaining entered information for next startup?

开发者 https://www.devze.com 2022-12-18 00:06 出处:网络
How would I code my android app to remember the values entered by the user between uses? As an example, say I have an EditText \"input1\" and a spinne开发者_如何学Pythonr \"input2\" which give result

How would I code my android app to remember the values entered by the user between uses?

As an example, say I have an EditText "input1" and a spinne开发者_如何学Pythonr "input2" which give results in a textview named "output1".

Currently when I close and reopen the app, all entered values and calculations are lost and reset.

How can I fix this?


You have three options. See all here.

In your case, file I/O and a database will be overkill. I recommend using the Preferences API.


You can use SQLite or the raw file system. The Notepad tutorial shows basic usage of SQLite.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号