Difference between persistent and non-persistent data

user3684678 picture user3684678 · Feb 18, 2016 · Viewed 10.2k times · Source

onPause() should be used to save persistent data and onSaveInstanceState(Bundle) is typically used to save non-persistent data.What does that mean?What is difference between persistent and non-persistent data?

Answer

Alexander Hoffmann picture Alexander Hoffmann · Feb 18, 2016

Persistent data is data which you want to be available even after you fully close and restart your app.

The three most common ways to safe this data localy is by using SharedPreferences, a local database or the file system (store data as a file).

Android Developers offers a guide for this: http://developer.android.com/training/basics/data-storage/index.html