I have an EditText and I want to be able to close my app and keep the last input in there for when I reopen my app. How would one go about this?
3 Answers
You are looking for persisting the data. The simplest way to achieve this would be saving it in Shared Preferences.
Developer link has good information on how to implement this - http://developer.android.com/training/basics/data-storage/shared-preferences.html
You can get the value from your editText and save with Key, Value pair and then retrieve it when user opens the app again and display.

- 606
- 1
- 4
- 14
I agree to @Natarajan Raman's answer, Either you can use SharedPreferences or SQLLite Database as when you application will be destroyed all its references and data from the memory will be garbage collected and hence you will need to store your data on a persisting storage

- 318
- 5
- 12
You can use SharedPreferences
Android provides several options for you to save persistent application data and one of them is Shared Preferences.Shared Preferences are stored as a file in the filesystem on the device .
A SharedPreferences object points to a file containing key-value pairs and provides simple methods to read and write them. Each SharedPreferences file is managed by the framework and can be private or shared.
Android provides several options for you to save persistent application data.Android allows to persists application data via the file system.
You can check

- 1
- 1

- 74,896
- 15
- 165
- 198