GSON throwing "Expected BEGIN_OBJECT but was BEGIN_ARRAY"?
<p>I'm trying to parse a JSON string like this one</p>

<pre><code>[
   {
      "updated_at":"2012-03-02 21:06:01",
      "fetched_at":"2012-03-02 21:28:37.728840",
      "description":null,
      "language":null,
      "title":"JOHN",
      "url":"http://rus.JOHN.JOHN/rss.php",
      "icon_url":null,
      "logo_url":null,
      "id":"4f4791da203d0c2d76000035",
      "modified":"2012-03-02 23:28:58.840076"
   },
   {
      "updated_at":"2012-03-02 14:07:44",
      "fetched_at":"2012-03-02 21:28:37.033108",
      "description":null,
      "language":null,
      "title":"PETER",
      "url":"http://PETER.PETER.lv/rss.php",
      "icon_url":null,
      "logo_url":null,
      "id":"4f476f61203d0c2d89000253",
      "modified":"2012-03-02 23:28:57.928001"
   }
]
</code></pre>

<p>into a list of objects.</p>

<pre><code>List&lt;channelSearchEnum&gt; lcs = (List&lt;channelSearchEnum&gt;) new Gson().fromJson( jstring , channelSearchEnum.class);
</code></pre>

<p>Here's an object class I'm using.</p>

<pre><code>import com.google.gson.annotations.SerializedName;

public class channelSearchEnum {



@SerializedName("updated_at")
private String updated_at;

@SerializedName("fetched_at")
private String fetched_at;

@SerializedName("description")
private String description;

@SerializedName("language")
private String language;

@SerializedName("title")
private String title;

@SerializedName("url")
private String url;

@SerializedName("icon_url")
private String icon_url;

@SerializedName("logo_url")
private String logo_url;

@SerializedName("id")
private String id;

@SerializedName("modified")
private String modified;

public final String get_Updated_at() {
    return this.updated_at;
}

public final String get_Fetched_at() {
    return this.fetched_at;
}

public final String get_Description() {
    return this.description;
}

public final String get_Language() {
    return this.language;
}

public final String get_Title() {
    return this.title;
}

public final String get_Url() {
    return this.url;
}

public final String get_Icon_url() {
    return this.icon_url;
}

public final String get_Logo_url() {
    return this.logo_url;
}

public final String get_Id() {
    return this.id;
}

public final String get_Modified() {
    return this.modified;
}

        }
</code></pre>

<p>But it throws me with</p>

<pre><code>com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2
</code></pre>

<p>Any ideas how should I fix it?</p>

<p>Thanks!</p>

<p><strong>EDIT :
Thanks for your replys. Got it working that way.</strong></p>

<pre><code>    Gson gson = new Gson();
    JsonParser parser = new JsonParser();
    JsonArray Jarray = parser.parse(jstring).getAsJsonArray();

    ArrayList&lt;channelSearchEnum&gt; lcs = new ArrayList&lt;channelSearchEnum&gt;();

    for(JsonElement obj : Jarray )
    {
        channelSearchEnum cse = gson.fromJson( obj , channelSearchEnum.class);
        lcs.add(cse);
    }
</code></pre>
