Olá, O código abaixo só compila se eu comentar a seção do map, mas eu preciso dela para preencher os parâmetros do 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);