Hello, The code below only compiles if I comment the map section, but I need it to populate the parameters of the post.
Erros: method onresponse onerrorresponse does not override its superclass
There is no applicable Constructor to 'int, java.lang.String, com.mycompany.AgendaConsulado.MainActivity.(anonymous), com.mycompany.AgendaConsulado.MainActivity.(anonymous))'
url = "http://httpbin.org/post";
StringRequest postRequest = new StringRequest(Request.Method.POST, url,
new Response.Listener<String>()
{
@Override
public void onResponse(String response) {
// response
Log.d("Response", response);
}
},
new Response.ErrorListener()
{
@Override
public void onErrorResponse(VolleyError error) {
// error
//Log.d("Error.Response", response);
}
}
) {
@Override
protected Map<String, String> getParams()
{
Map<String, String> params = new HashMap<String, String>();
params.put("name", "Alif");
params.put("domain", "http://itsalif.info");
return params;
}
};
queue.add(postRequest);