Skip to content

Instantly share code, notes, and snippets.

@Pierry
Created November 5, 2014 16:27
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/215b7bc4f1262209cfb1 to your computer and use it in GitHub Desktop.
Save Pierry/215b7bc4f1262209cfb1 to your computer and use it in GitHub Desktop.
Volley String
// Request a string response from the provided URL.
StringRequest stringRequest = new StringRequest(Request.Method.GET, url,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
// Display the first 500 characters of the response string.
etUser.setText("Response is: "+ response.substring(0,500));
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
etPass.setText("That didn't work!");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment