title: Android Volley to parse JSON and put into listview is not working
body: <p>I am using this guide here:</p>
  
  <p><a href="http://www.androidhive.info/2014/07/android-custom-listview-with-image-and-text-using-volley/" rel="nofollow">http://www.androidhive.info/2014/07/android-custom-listview-with-image-and-text-using-volley/</a></p>
  
  <p>I put</p>
  
  <pre><code>System.out.println(error.getMessage());
  </code></pre>
  
  <p>in my code below and here were the errors it was showing me:</p>
  
  <pre><code>01-13 18:53:21.425 1915-1915/com.app.dev.myapplication I/System.out: org.json.JSONException: Value {"server_response":[{"first_name":"bob","last_name":"john","user_name":"bobthebuilder","avatar":"stringOfURL"}]} of type org.json.JSONObject cannot be converted to JSONArray
  01-13 18:53:21.425 1915-1915/com.app.dev.myapplication D/Volley: [1] 2.onErrorResponse: SearchActivity
  </code></pre>
  
  <p>Here is my JSON Code:</p>
  
  <pre><code>{"server_response":[{"first_name":"bob","last_name":"john","user_name":"bobthebuilder","avatar":"stringOfURL"}]}
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>public class SearchActivity extends AppCompatActivity {
  
  String JSON_STRING,sq,js_username,js_first_name,js_last_name,js_avatar;
  EditText et_sq;
  private static final String json_user_search_url = "http://www.domain.com/string.php";
  private static final String TAG = SearchActivity.class.getSimpleName();
  private List&lt;SearchResults&gt; movieList = new ArrayList&lt;SearchResults&gt;();
  private ListView listView;
  private CustomListAdapter adapter;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_search);
      getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  
      listView = (ListView) findViewById(R.id.listViewSearch);
      adapter = new CustomListAdapter(this, movieList);
      listView.setAdapter(adapter);
  
      // Creating volley request obj
      JsonArrayRequest movieReq = new JsonArrayRequest(json_user_search_url, new Response.Listener&lt;JSONArray&gt;() {
  
                  @Override
                  public void onResponse(JSONArray response) {
                      Log.d(TAG, response.toString());
  
                      // Parsing json
                      for (int i = 0; i &lt; response.length(); i++) {
                          try {
  
                              JSONArray responseArray = response.getJSONArray("server_response");
                              JSONObject content = responseArray.getJSONObject(0);
                              SearchResults movie = new SearchResults();
                              movie.setUser_name(obj.getString("user_name"));
                              movie.setFirst_name(obj.getString("first_name"));
                              movie.setLast_name(obj.getString("last_name"));
                              movie.setAvatarUrl(obj.getString("avatar"));
  
                              // adding movie to movies array
                              movieList.add(movie);
  
                          } catch (JSONException e) {
                              e.printStackTrace();
                          }
  
                      }
  
                      adapter.notifyDataSetChanged();
                  }
              }, new Response.ErrorListener() {
          @Override
          public void onErrorResponse(VolleyError error) {
              System.out.println(error.getMessage());
              VolleyLog.d(TAG, "Error: " + error.getMessage());
  
          }
      });
  
      // Adding request to request queue
      AppController.getInstance().addToRequestQueue(movieReq);
  }
  </code></pre>
  
  <p>}</p>