title: null pointer exception-parsing json with gson android
body: <p>Hi i am trying to parse Json using gson library.My Json String is this</p>
  
  <pre><code>{
  "data": [
      {
          "atb_atestwebservice_cities": [
              {
                  "id": "3",
                  "cities": "Ajmer",
                  "date": "2012-03-01 19:30:32"
              }
          ]
      },
      {
          "atb_atestwebservice_states": [
              {
                  "id": "2",
                  "states": "goa",
                  "date": "2012-02-28 12:53:51"
              }
          ]
      }
  ]
  </code></pre>
  
  <p>}
  With following classes</p>
  
  <pre><code>public class Cities {
  
  @SerializedName("id")
  private String id;
  
  @SerializedName("cities")
  private String cities;
  
  @SerializedName("date")
  private String date;
  
  public Cities(String id,String city,String date)
  {
      this.id=id;
      this.date=date;
      this.cities=city;
  
  }
  public String getId()
  {
      return id;
  }
  public String getCity()
  {
      return cities;
  }
  public String getDate()
  {
      return date;
  }
  </code></pre>
  
  <p>}
   and </p>
  
  <pre><code>public class States {
  @SerializedName("id")
  private String id;
  
  @SerializedName("states")
  private String states;
  
  @SerializedName("date")
  private String date;
  
   public States(String id,String states,String date)
  {
      this.id=id;
      this.date=date;
      this.states=states;
  
  }
  public String getId()
  {
      return id;
  }
  public String getCity()
  {
      return states;
  }
  public String getDate()
  {
      return date;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>and a data class</p>
  
  <pre><code>public class Data {
  
  
  
   private List&lt;Cities&gt; atb_atestwebservice_cities;
  
   private List&lt;States&gt; atb_atestwebservice_states;
  
   public Data(List&lt;Cities&gt; cityList,List&lt;States&gt;stateList)
   {
       this.atb_atestwebservice_cities=cityList;
       this.atb_atestwebservice_states=stateList;
   }
  
  
   public List&lt;Cities&gt; getCityList()
   {
       return atb_atestwebservice_cities;
   }
  
   public void setCityList(List&lt;Cities&gt; cityList)
   {
       this.atb_atestwebservice_cities=cityList;
   }
  
   public List&lt;States&gt; getSateList()
   {
       return atb_atestwebservice_states;
   }
  
   public void setDatList(List&lt;States&gt; stateList)
   {
       this.atb_atestwebservice_states=stateList;
   }
  </code></pre>
  
  <p>}
   and code to deserialize the json string</p>
  
  <pre><code>Gson gson = new Gson();
  Data data = gson.fromJson(jsonString,Data.class);
  </code></pre>
  
  <p>The problem is i am getting null pointer exception.i have referred this <a href="http://www.javacodegeeks.com/2011/01/android-json-parsing-gson-tutorial.html" rel="nofollow">link</a> for parsing.I am not sure what is the problem.Are my POJO classes proper or do i need to modify or add some more class ?
  EDIT:here is my log cat</p>
  
  <pre><code>  03-14 14:59:31.694: ERROR/AndroidRuntime(323): java.lang.NullPointerException
  03-14 14:59:31.694: ERROR/AndroidRuntime(323):     at com.jimesh.ShowData$LongOperation.onPostExecute(ShowData.java:88)
  03-14 14:59:31.694: ERROR/AndroidRuntime(323):     at com.jimesh.ShowData$LongOperation.onPostExecute(ShowData.java:1)
  03-14 14:59:31.694: ERROR/AndroidRuntime(323):     at android.os.AsyncTask.finish(AsyncTask.java:417)
  03-14 14:59:31.694: ERROR/AndroidRuntime(323):     at android.os.AsyncTask.access$300(AsyncTask.java:127)
  03-14 14:59:31.694: ERROR/AndroidRuntime(323):     at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:429)
  03-14 14:59:31.694: ERROR/AndroidRuntime(323):     at android.os.Handler.dispatchMessage(Handler.java:99)
  03-14 14:59:31.694: ERROR/AndroidRuntime(323):     at android.os.Looper.loop(Looper.java:123)
  03-14 14:59:31.694: ERROR/AndroidRuntime(323):     at android.app.ActivityThread.main(ActivityThread.java:4627)
  03-14 14:59:31.694: ERROR/AndroidRuntime(323):     at java.lang.reflect.Method.invokeNative(Native Method)
  03-14 14:59:31.694: ERROR/AndroidRuntime(323):     at java.lang.reflect.Method.invoke(Method.java:521)
  03-14 14:59:31.694: ERROR/AndroidRuntime(323):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
  03-14 14:59:31.694: ERROR/AndroidRuntime(323):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
  03-14 14:59:31.694: ERROR/AndroidRuntime(323):     at dalvik.system.NativeStart.main(Native Method)
  </code></pre>