jeudi 26 mars 2015

Gson deserialize to List?> where generic type of list is given as classname

I need a function of the following form



List<?> deserialize(String className, String jsonString){
}


Here the jsonString can be something like the following and the className will be some thing like com.example.mycontact


[{"name":"myName","mobile":"12344557899"},{"name":"myName","mobile":"12344557899"}]


Now how do I use gson to convert it to list of Contact. Note that it need not be contact in a different call.






Aucun commentaire:

Enregistrer un commentaire