Closed GoogleCodeExporter closed 9 years ago
If you change your Type
from -- Type typeOfHashMap=new
TypeToken<Map<String,List<Object>>>(){}.getType();
to -- Type typeOfHashMap=new TypeToken<Map<String,List<User>>>(){}.getType();
the deserialization is successful. I believe your original code is incorrectly
using the Type class. If you have to set up a custom Type, you should be as
specific as possible.
Original comment by jack.roy...@gmail.com
on 1 May 2014 at 11:10
Do what #1 said and it will fix your issue. If no type information is available
Gson will deserialize into a Map as the exception clearly outlines.
Original comment by j...@squareup.com
on 9 Aug 2014 at 5:48
Original issue reported on code.google.com by
hechangg...@yeah.net
on 17 Dec 2013 at 9:20Attachments: