private void loadMeme() { // Instantiate the RequestQueue. RequestQueue queue = Volley.newRequestQueue(this); String url ="https://meme-api.herokuapp.com/gimme"; // Request a string response from the provided URL. JsonObjectRequest JsonObjectRequest = new JsonObjectRequest(Request.Method.GET, url,(String)null, new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject response) { String url = null; try { url = response.getString("url"); } catch (JSONException e) { e.printStackTrace(); } ImageView memeImageView = (ImageView) findViewById(R.id.memeImageView); Glide.with(this).load(url).into(memeImageView); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { } });
Glide.with(this).load(url).into(memeImageView);
compile 'com.github.bumptech.glide:glide:3.7.0'
GlideApp
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)