My object contains a String, long, and int. Object is called Tracker and I have an arrayList of Trackers. When I try to use toJson i get an error. The same with fromJson.
You can take a look at my SharedPreferences helper
// Save list object to another SharedPreference
SharedPreferencesManager.getInstance(AnotherPreferenceName).putValue("guns", guns);
List datas = SharedPreferencesManager.getInstance(AnotherPreferenceName).getValues("guns", Gun[].class); // get list object