Skip to content

Instantly share code, notes, and snippets.

@Pierry
Created November 5, 2014 16:37
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 Pierry/84c9228ed232723e0734 to your computer and use it in GitHub Desktop.
Save Pierry/84c9228ed232723e0734 to your computer and use it in GitHub Desktop.
JSONObject
String url ="http://ip.jsontest.com/";
JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.GET, url, null,
new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
etUser.setText("Response :" + response.toString());
}
}, new Response.ErrorListener(){
@Override
public void onErrorResponse(VolleyError error) {
}
});
ServiceSingleton.getInstance(this).addToRequestQueue(jsonObjectRequest);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment