Created
December 6, 2017 14:12
-
-
Save Ray33/bdb0d7681656ee2c50a380da4a6b52bd to your computer and use it in GitHub Desktop.
Call visibility URL on bind
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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