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.
精彩评论