0

I am trying to save JSON array to local storage in Android and I can't retrieve it

//that to send Json array to shared preferences 
save.edit().putString("courses", courses.toString()).apply();
//that to retrieve it
    String jsonObject = PreferenceManager.
            getDefaultSharedPreferences(this).getString("courses","");

What is the solution for this problem?

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
  • 1
    You can look into this **[answer here](https://stackoverflow.com/a/15588512/2065039)** – Guruprasad J Rao Dec 05 '17 at 18:54
  • 5
    Possible duplicate of [store and retrieve a class object in shared preference](https://stackoverflow.com/questions/5418160/store-and-retrieve-a-class-object-in-shared-preference) – Steven Dec 05 '17 at 19:09

0 Answers0