title: How to convert JSONArray to List with Gson?
body: <p>In my Android project I'm trying to convert a received JSONArray to a List. With the help of <a href="https://stackoverflow.com/questions/8371274/how-to-parse-json-array-in-android-with-gson">this SO answer</a> I got a bit further. I now have the following code:</p>
  
  <pre><code>Gson gson = new Gson();
  JSONArray jsonArray = NetworkUtilities.getData("mymodeldata");
  Type listType = new TypeToken&lt;List&lt;MyModel&gt;&gt;(){}.getType();
  List&lt;MyModel&gt; myModelList = gson.fromJson(jsonArray, listType);
  </code></pre>
  
  <p>Unfortunately it complaints at the last line that the method fromJson(String, Type) in the type Gson is not applicable for the arguments (JSONArray, Type). I don't really know how to solve this.</p>
  
  <p>Does anybody know how I can solve this?</p>