Forum General

API doesn't providing the response becuase of mScrollCache.fadingEdgeLength=java.lang.NullPointerExc

priyanka369priyanka369 Member ✭✭

Getting an exception when calling the API by using the Volley library at the StringRequest class.

Code:

RequestQueue queue = Volley.newRequestQueue(this);
 String mail= emailET.getText().toString();
 String password=passwordET.getText().toString();

 String url ="http://*****.com/controller/api/Login/Login?EmailID=" +  mail  + "&Password=" + password;
 StringRequest request1=new StringRequest(Request.Method.GET, url, new Response.Listener<String>(){

 @Override
 public void onResponse(String response) {

 try {
JSONObject object=new JSONObject(response);

} catch (JSONException e) {
     e.printStackTrace();
  }
 }
}, new Response.ErrorListener() {
 @Override
 public void onErrorResponse(VolleyError error) {

                }
});
queue.add(request1);

The exception has occurred at the StringRequest line when doing debug.

And here's the error screenshot:

Sign In or Register to comment.