I am using following method to retrieve a bitmap from the url and pass it on to the imageview , but the imageview is not being updated.
public static Bitmap LoadImageFromWebOperations(String url) {
Bitmap bitmap;
try {
InputStream is = new URL(url).openStream();
bitmap = BitmapFactory.decodeStream(is);
return bitmap;
} catch (Exception e) {
return null;
}
call -
mov1_poster.setImageBitmap(VPmovies.LoadImageFromWebOperations(mov_details[0][7]));
//doesn't work
Toast.makeText(this,"url is \n"+mov_details[0][7],Toast.LENGTH_LONG).show();
// shows the url of the image successfully (just to check the url is not null)
Is there anything i am doing wrong ? Please help.
Use the picasso library when working with images, it works wonders and it's easy!
Now call in your code: