Reputation: 109
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 spinner
"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?
Upvotes: 0
Views: 114
Reputation: 5967
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.
Upvotes: 5
Reputation: 3401
You can use SQLite or the raw file system. The Notepad tutorial shows basic usage of SQLite.
Upvotes: 2