parametros en blanco
Publicado por Jose Luis (3 intervenciones) el 27/05/2021 16:13:48
Buenos días, tengo un problema con los parametros para insertar registros en mysql, el codigo es el sig.:
resulta que el array 'parametro', no me carga los datos, hasta ahi los edittext llegan con datos, pero el array me da nulo...
espero haberme expresado bien y puedan ayudarme, desde ya muchas gracias.-
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
private void insertarCliente(String URL){
StringRequest stringRequest=new StringRequest(Request.Method.POST, URL, new Listener<String>() {
@Override
public void onResponse(String response) {
Toast.makeText(getApplicationContext(),"Cliente registrado con éxito",Toast.LENGTH_SHORT).show();
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
System.out.println(error.toString());
Toast.makeText(getApplicationContext(),error.toString(),Toast.LENGTH_SHORT).show();
}
}){
@Override
protected Map<String,String> getParams() throws AuthFailureError {
Map<String,String> parametro=new HashMap<String,String>();
parametro.put("id",etIdCliente.getText().toString());
parametro.put("nombre",etNombreCliente.getText().toString());
System.out.println(parametro);
return parametro;
}
};
requestQueue= Volley.newRequestQueue(this);
requestQueue.add(stringRequest);
}
resulta que el array 'parametro', no me carga los datos, hasta ahi los edittext llegan con datos, pero el array me da nulo...
espero haberme expresado bien y puedan ayudarme, desde ya muchas gracias.-
Valora esta pregunta


0