📜  jsonarray 到 java 代码示例中的列表

📅  最后修改于: 2022-03-11 14:52:25.808000             🧑  作者: Mango

代码示例3
// Top of file
import java.lang.reflect.Type;

// ...

private void parseJSON() {
    Gson gson = new Gson();
    Type type = new TypeToken>(){}.getType();
    List contactList = gson.fromJson(jsonString, type);
    for (ContactModel contact : contactList){
        Log.i("Contact Details", contact.id + "-" + contact.name + "-" + contact.email);
    }
}