Hello guys can someone help me with this class? I am getting an error and I am only new to the android studio and mobile development. I'm in the process of learning and acquiring knowledge. Please help me.
RequestQueue requestQueue = Volley.newRequestQueue(this);
StringRequest stringRequest = new StringRequest(Request.Method.POST, URL, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
Toast.makeText(Register.this, response, Toast.LENGTH_LONG).show();
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Toast.makeText(Register.this, error.toString(), Toast.LENGTH_LONG).show();
}
}) {
@Override
protected Map<String, String> getParams() throws AuthFailureError {
Map<String, String> params = new HashMap<String, String>();
params.put(NAME, pangaran);
params.put(SURNAME, apelyido);
params.put(ADDRESS, lugar);
params.put(CONTACTNO, kontak);
params.put(USERNAME, username1);
params.put(PASSWORD, password1);
return params;
}
};
requestQueue.add(stringRequest);