json - GSON parsing android -


this json:

{     "curs": [         {             "id": "aed",             "name": "dirhamul emiratelor arabe",             "curs": "0.8503",             "multiplier": "1",             "data": "2011-02-09"         },         {             "id": "aud",             "name": "dolarul australian",             "curs": "3.1572",             "multiplier": "1",             "data": "2011-02-09"         }     ] } 

this class:

public class curs {  @serializedname("id") public string id;  @serializedname("name") public string nume;  @serializedname("curs") public  double crs;  @serializedname("multiplier") public  int mult;  @serializedname("data") public  date data;  public string getid() {     return id; } public void setid(string id) {     this.id = id; } public string getnume() {     return nume; } public void setnume(string nume) {     this.nume= nume; } public void setcrs(double crs) {     this.crs=crs; } public double getcrs(){     return crs; } public void setmult(int mult) {     this.mult=mult; } public int getmult(){     return mult; } public void setdata(date data) {     this.data=data; } public date getdata(){     return data; } 

}

and class contains list:

public class curslist {  public static list<curs> listacurs;  public void setcurslist(list <curs> listacurs) {     this.listacurs = listacurs; }  public list<curs> getcurslist() {     return listacurs; } 

}

i parsing this:

gson gson=new gson();      curslist listacurs=gson.fromjson(jsonresult,curslist.class); 

when access list null pointer.what doing wrong?

found stupid problem . json doesn't accept date format . problem. help.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -