Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. public JSONObject result;
  2.  
  3. public JSONObject getResponse(String url, Context mContext) {
  4. RequestQueue mQueue = Volley.newRequestQueue(mContext);
  5. JsonObjectRequest request = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>() {
  6. @Override
  7. public void onResponse(JSONObject response) {
  8. Log.e(TAG, "Anshuman" + response.toString());
  9.  
  10. result = response;
  11. }
  12. },
  13. new Response.ErrorListener() {
  14. @Override
  15. public void onErrorResponse(VolleyError error) {
  16. VolleyLog.d(TAG, "Error: " + error.getMessage());
  17. }
  18. });
  19.  
  20. mQueue.add(request);
  21. return result;
  22. }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement