Skip to content

Instantly share code, notes, and snippets.

@Ray33
Created December 6, 2017 14:12
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 Ray33/bdb0d7681656ee2c50a380da4a6b52bd to your computer and use it in GitHub Desktop.
Save Ray33/bdb0d7681656ee2c50a380da4a6b52bd to your computer and use it in GitHub Desktop.
Call visibility URL on bind
@Override
public void onBindViewHolder(final ViewHolder viewHolder, final int i) {
NewsArticle newsArticle = newsArticles.get(i);
final String articleVisibleUrl = newsArticle.visibleUrl;
if (!TextUtils.isEmpty(articleVisibleUrl) && newsArticle.isPromoted) {
Volley.newRequestQueue(context).add(new StringRequest(articleVisibleUrl, new Response.Listener<String>() {
@Override
public void onResponse(String s) {
// Do nothing
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError volleyError) {
// Do nothing
}
}));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment