Main Code
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.mo
Add getter and setter methods for your Image like
public String getImageUrl() {
return imageUrl;
}
public void setImageUrl(String imgUrl) {
imageUrl= imgUrl;
}
Add this code in your adapter class after adding Picasso library to your project:
String imageUrl = movieData.get(position).getImageUrl();
Picasso.with(getContext())
.load(imageUrl)
.into(holder.movieImage, new com.squareup.picasso.Callback() {
@Override
public void onSuccess() {
}
@Override
public void onError() {
}
});
I am using this library and loading images by
first creating the Display options object by
DisplayImageOptions builder = new DisplayImageOptions.Builder()
.cacheOnDisk(true)
.showImageOnLoading(R.drawable.empty_photo)
.showImageForEmptyUri(R.drawable.empty_photo)
.build();
Then initialze the image loader by
ImageLoader imageLoader = ImageLoader.getInstance();
and load images by
imageLoader.displayImage(url, imageView, builder);
Hope this helps.. also add this to you gradle
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
Refer this first
EDIT: Add this to onCreate()
of activity
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this)
...
.build();
ImageLoader.getInstance().init(config);
or this
ImageLoader.getInstance().init(ImageLoaderConfiguration.createDefault(Activity.this));