title: json array in hashmap using google gson
body: <p>I am new with Gson and I am trying to parse array of object in a <code>Hashmap</code>, but I am getting <code>com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 3</code>.</p>
  
  <p>My code is</p>
  
  <pre><code>Map&lt;String, String&gt; listOfCountry = new HashMap&lt;String, String&gt;();
  Gson gson = new Gson();
  Type listType = new TypeToken&lt;HashMap&lt;String, String&gt;&gt;() {}.getType();
  listOfCountry = gson.fromJson(sb.toString(), listType);
  </code></pre>
  
  <p>and JSON is </p>
  
  <pre><code>[
    {"countryId":"1","countryName":"India"},
    {"countryId":"2","countryName":"United State"}
  ]
  </code></pre>