You have a few options here:
- Pass
Contextas an argument to FeedAdapter and keep it as class field - Use dependency injection to inject
Contextwhen you need it. I strongly suggest reading about it. There is a great tool for that — Dagger by Square -
Get it from any
Viewobject. In your case this might work for you:holder.pub_image.getContext()As
pub_imageis aImageView.