Introduction to SharedPreferences
How to put and get data from a preferences file
How to share a preferences file between Activities
Android apps do not persist your data by default. It’s your responsibility to make the data durable and resilient throughout the app’s life cycle. Let’s say you’re collecting data from the user, then midway into your workflow, the application gets interrupted by another app. There is no guarantee that whatever data the user has already input will be there when your app comes back.