Note that there are some explanatory texts on larger screens.

plurals
  1. POGSON parsing android
    primarykey
    data
    text
    <p>This is my JSON: </p> <pre><code>{ "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" } ] } </code></pre> <p>This is my class: </p> <pre><code>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; } </code></pre> <p>}</p> <p>And this is the class that contains my list:</p> <pre><code>public class CursList { public static List&lt;Curs&gt; listaCurs; public void setCursList(List &lt;Curs&gt; listaCurs) { this.listaCurs = listaCurs; } public List&lt;Curs&gt; getCursList() { return listaCurs; } </code></pre> <p>}</p> <p>I do the parsing like this:</p> <pre><code>Gson gson=new Gson(); CursList listaCurs=gson.fromJson(Jsonresult,CursList.class); </code></pre> <p>When i access the list i get a null pointer.What am i doing wrong?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload