Skip to content

Instantly share code, notes, and snippets.

@mbarcia
Last active January 4, 2016 21:29
Show Gist options
  • Save mbarcia/8681592 to your computer and use it in GitHub Desktop.
Save mbarcia/8681592 to your computer and use it in GitHub Desktop.
Creating an instance of a Volley request by means of an adapter class, and adding it to the queue for execution. Part of http://develop-for-android.blogspot.com.es/2014/01/using-volley-in-your-application_28.html
String baseUrl =
"http://www.webservicex.net/currencyconvertor.asmx/ConversionRate";
// using the cached request
Request<String> request = new CachedStringGETRequest(
baseUrl + "?fromCurrencyCode=USD&toCurrencyCode=EUR",
new ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.w("exampleapp", "Exchange rate USD " +
"to EUR failed to update. " + error );
}
});
Volley.newRequestQueue(this).add(request);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment