title: How to parse json parsing Using GSON in android
body: <p>I am using <code>GSON</code> for parse Json data. My Json data is below:</p>
  
  <pre><code>{
      "count": "12",
      "colbreak": 1,
      "name": "unary rels",
      "score": "9090",
      "Words": [
          {
              "count": 6,
              "word": "prp_għaċ-",
              "name": "prp_għaċ-",
              "score": 9.1,
              "Words": "kol",
              "seek": 2231297
          }
      ],
      "seek": 0
  }
  </code></pre>
  
  <p><strong>GsonParse.java</strong></p>
  
  <pre><code>public class GsonParse {
  
  
   @SerializedName("count")
   public String count;
  
   @SerializedName("colbreak")
   public String colbreak;
  
   @SerializedName("name")
   public String count;
   @SerializedName("score")
   public String score;
  
   @SerializedName("Words")
   public List&lt;Words&gt; mWords = new ArrayList&lt;Words&gt;();
  
   @SerializedName("seek")
   public String seek;
  }
  </code></pre>
  
  <p>I am using below method to parse this JSON data.</p>
  
  <pre><code>public static &lt;T&gt; ArrayList&lt;T&gt; JsonParse(T t, String response) {
          // convert String into InputStream
          InputStream in = new ByteArrayInputStream(response.getBytes());
          JsonReader reader;
          ArrayList&lt;T&gt; lcs = new ArrayList&lt;T&gt;();
          try {
              reader = new JsonReader(new InputStreamReader(in, "UTF-8"));
              Gson gson = new Gson();
  
              reader.beginObject();
              while (reader.hasNext()) {
  
                  T cse = (T) gson.fromJson(reader, t.getClass());
                  lcs.add(cse);
              }
  
              reader.endObject();
  
              /*
               * reader.nextName(); reader.nextString(); reader.nextName();
               * reader.nextString();
               */
              reader.close();
          } catch (UnsupportedEncodingException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          } catch (IOException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
  
          return (ArrayList&lt;T&gt;) lcs;
      }
  </code></pre>
  
  <p>I am facing below error.</p>
  
  <pre><code>03-31 10:14:26.968: E/AndroidRuntime(18578): com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was NAME at line 1 column 73
  </code></pre>