Volley gives me the following error JsonObjectResquest

1

I'm working with Volley but I get an error when using it in the method. Can anybody help me? Thanks:

public void sendResponse(){
        RequestQueue requestQueue = Volley.newRequestQueue(this);

        JsonObjectRequest jsObjectRequest = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>() {
            @Override
            public void onResponse(JSONObject response) {

                try {
                    System.out.print(response.getString("amiiboSeries"));
                } catch (JSONException e) {
                    e.printStackTrace();
                }

            }
        },
                new Response.ErrorListener() {
                    @Override
                    public void onErrorResponse(VolleyError error) {
                        Log.d("TAG", "Error Respuesta en JSON: " + error.getMessage());

                    }
                });
            requestQueue.add(jsObjectRequest);
    }

I get the error:

  

Can not resolve constructor 'JsonObjectResquest (int, (java.lang.String,   null, anonymus   com.Android.volley.Response.Listener, Anonymus   com.Android.Volley.Response.ErrorListener) '

    
asked by PacoPepe 17.01.2018 в 13:25
source

1 answer

0

You are using the version of Volley mcxiaoke which is obsolete, and does not contain the class JsonObjectResquest .

You must use the latest version of Android Volley and set it up in your build.gradle file, for example:

dependencies {
    ...
    compile 'com.android.volley:volley:1.1.0'
    ...
}
    
answered by 17.01.2018 в 16:58