0
我在这里遇到一种情况。我是否可以通过gson知道如何通过下面的示例从“地点”获取json?在Android中从GSON获取对象
near.java:
public class near{
private List<Place> place;
private String type;
public List<Place> getPlace(){
return this.place;
}
public void setPlace(List<Place> place){
this.place = place;
}
public String getType(){
return this.type;
}
public void setType(String type){
this.type = type;
}
}
place.java:
public class Place{
private String name;
public String getname(){
return this.name;
}
public void setname(String name){
this.name = name;
}
}
我知道,在不久的类获取类型,它是
Gson json=new Gson();
near resultType =json.fromJson(result , near.class);
我可以知道如何在PLACE类中获得NAME?谢谢..
可我知道什么是得到(0)代表什么? – davidlee
get(N)是返回第N个元素的列表方法:http://download.oracle.com/javase/6/docs/api/java/util/List.html#get(int) – MByD
我可以知道如何将PLACE类放入setListAdapter或ArrayAdapter? – davidlee