Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
private StringRequest stringRequest = new StringRequest(Request.Method.POST, url_register, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
String result = response.toString();
textView.setText(result);
Log.d("vol ", "onResponse: "+result);
////////// CONVERT STRING TO JSON
try {
JSONObject stringJSON = new JSONObject(result);
String code=stringJSON.getString("code");
textView.setText(code);
}catch (Exception e){}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
String eror = error.toString();
}
}){
@Override
protected Map<String, String> getParams() {
Map<String, String> params = new HashMap<String, String>();
String name = "";
String email = "myemail@gmail.com";
String passwd = "xyz321";
params.put("name", name);
params.put("email", email);
params.put("passwd", passwd);
return params;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment