开发者

Retaining entered information for next startup?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜