Skip to content

Instantly share code, notes, and snippets.

@imammubin
Created January 24, 2019 17:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imammubin/e7b6aea4edec7be83f8091d0cbd7b01f to your computer and use it in GitHub Desktop.
Save imammubin/e7b6aea4edec7be83f8091d0cbd7b01f to your computer and use it in GitHub Desktop.
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