In my backend I have a class User which has multiple Trips. Those trips have multiple user. This is a circular reference.
I use this code in my rest service to serialize the user object:
Gson gson = new Gson();
return gson.toJson(user, TripUser.class);
In my android app I do the following:
Gson gson = new Gson();
TripUser Tuser = gson.fromJson(data, TripUser.class);
return Tuser;
What can I do about the circular reference exception? Is there another way to make this work?