Answers for "convert jsonarray to list of string"

-1

convert json to arraylist java

// Top of file
import java.lang.reflect.Type;

// ...

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

Code answers related to "convert jsonarray to list of string"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language