I have an app that records user inputs in EditTexts and then displays them in the second activity as a textView. However every time I close the app, those text fields reset. How could I save user input so that it will stay, even when the app is closed? Also, is there a way to reset the app with empty EditTexts every 24 hours.
Asked
Active
Viewed 45 times
3 Answers
2
- Option 1: You can use SharedPreferences or DataStore
- Option 2: Use local databases like SQLite (you can use Room)
![](../../users/profiles/12053756.webp)
Jagar
- 336
- 1
- 8
1
Use SharedPreferences or Preferences DataStore to persist data even after closing the app.
![](../../users/profiles/11208036.webp)
SABANTO
- 731
- 5
- 18
0
As the others said you can use SharedPreferences or Room.
Click here for Room Database or here for SharedPreferences
Alternatively a guide to Room Database from an official source: here
![](../../users/profiles/11088681.webp)
DeltaReloadX
- 23
- 4