Hello everyone.
I have a problem with convert the object to json. I'm using gson to convert the java object to json string, but i got an error for this. Below is the describe
I have a class Bus
class Bus{
private int id;
private Route route;
}
class Route{
private int id;
private List<Bus> listBus;
}
When i using gson to convert the bus object to json,
Gson gson = new Gson();
Bus bus = getABus();
String json = gson.toJson(bus);
it generate this erros:
com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68)
Could anyone know how to solve this problem please?
Thanks
Clark