Created
September 23, 2013 10:14
-
-
Save meeDamian/6668665 to your computer and use it in GitHub Desktop.
Simple download JSON example using Volley
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Volley.newRequestQueue(this).add( | |
| new JsonObjectRequest(Request.Method.GET, "http://your-url.com/file.json", null, | |
| new Response.Listener<JSONObject>() { | |
| @Override | |
| public void onResponse(JSONObject response) {} // what happens on success? | |
| }, new Response.ErrorListener() { | |
| @Override | |
| public void onErrorResponse(VolleyError error) {} // what happens on fail? | |
| }) | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment