Volley Request template

StringRequest strReq = new StringRequest(Request.Method.POST, URL, new Response.Listener<String>() { @Override public void onResponse(String response) { //here is the response of server } catch (JSONException e) { e.printStackTrace(); } } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { progressDialog.dismiss(); } }) { @Override protected Map<String, String> getParams() { // Posting params to register url HashMap<String, String> user = db.getUserDetails(); String id = user.get("uid"); Map<String, String> params = new HashMap<String, String>(); params.put("user_id", id); return params; } }; // Adding request to request queue AppController.getInstance().addToRequestQueue(strReq, "tag");

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.