android - Gson Parse Json with array with different object types -
android - Gson Parse Json with array with different object types - how can parse json using gson? have array multiple object types , don't know kind of object need create save structure. cannot alter json message (i don't command server). the class function (sort of) this public class response { private list<object> tr; private int results; (...) } json message (note array multiple object types.) { "tr": [ { "a": { "userid": "112" } }, { "b": { "userid": "123", "address":"street dummy" } }, { "a": { "userid": "154" } } ], "results":3 } the gson user's guide explicitly covers this: https://si...