So I would like to save an arrayList of strings in onPause and get it back in onResume but the problem is I can’t use sharedPreferences because my API level is 8 and I can’t use the putStringSet function. Also, I would like to avoid saving data to the user’s phone via a file system. I’m already doing that with several other things.
Is there any other way to save the data? I’ve tried putting a bundle in onPause and getting it in onResume and that hasn’t worked, I’ve also tried implementing onSavedInstanceState and onRestoreInstanceState but those only get called when the activity is destroyed and I’m only putting it on pause most of the time.
You can use Modified Shared Preference to store your ArrayList. I was trying similar and I got answer for that. Here is the link. CustomSharedPreference
Here You can create one class with getter and setter for ArrayList and that class as a object in Shared Preference.