title: How to parse JSON using volley library android
body: <p>I parsed JSON response using <code>Volley library</code> as done in <a href="https://www.youtube.com/watch?v=FzwBYPzCIHk" rel="nofollow noreferrer">this video</a>. But I am getting an error. The error is: </p>
  
  <blockquote>
    <p>E/VOLLEY: ERROR</p>
  </blockquote>
  
  <p>Can somebody help me, please? I don't know what the problem is. </p>
  
  <p><strong>EDIT</strong>: Added code</p>
  
  <pre><code>package com.example.hello.Project;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.util.Log;
  import android.view.View;
  import android.widget.Button;
  import android.widget.TextView;
  
  import com.android.volley.Request;
  import com.android.volley.RequestQueue;
  import com.android.volley.Response;
  import com.android.volley.VolleyError;
  import com.android.volley.toolbox.JsonObjectRequest;
  import com.android.volley.toolbox.Volley;
  
  import org.json.JSONArray;
  import org.json.JSONException;
  import org.json.JSONObject;
  
  public class Activity1 extends Activity {
  
  Button start;
  TextView textView;
  RequestQueue requestQueue;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity1);
  
  start = (Button) findViewById(R.id.btn);
  textView = (TextView) findViewById(R.id.textView2);
  requestQueue = Volley.newRequestQueue(this);
  
  start.setOnClickListener(new View.OnClickListener(){
      @Override
      public void onClick(View v){
  
          JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.GET, "http://example.com/abc.json",
                  new Response.Listener&lt;JSONObject&gt;() {
                      @Override
                      public void onResponse(JSONObject response) {
  
                          try {
                              JSONArray jsonArray = response.getJSONArray("abc");
  
                              for(int i = 0; i &lt; jsonArray.length(); i++) { 
  
                                  JSONObject student = jsonArray.getJSONObject(i);
  
                                  String a= student.getString("a");
                                  String b= student.getString("b");
                                  String c= student.getString("c");
                                  String d= student.getString("d");
  
                                  textView.append(a+" \n"+b+" \n"+c+" \n "+d+" \n");
  
                              }
                          } catch (JSONException e){
                              e.printStackTrace();
                          }
                      }
                  },
  
                  new Response.ErrorListener() {
                      @Override
                      public void onErrorResponse(VolleyError error) {
                          Log.e("VOLLEY","ERROR");
                      }
                  }
  
  
          );
  
          requestQueue.add(jsonObjectRequest);
      }
  });
  }
  }
  </code></pre>
  
  <p>This is the code.</p>