I wanna set Image in ImageView using Url for example I have this url
http://www.google.iq/imgres?hl=en&biw=1366&bih=667&tbm=isch&tbni
With the latest version of Picasso (2.71828 at the time of writing this answer), the with
method has been deprecated.
So the correct way would be-
Picasso.get().load("https://<image-url>").into(imageView);
where imageView
is the ImageView you want to load your image into.
Try:
URL newurl = new URL(photo_url_str);
mIcon_val = BitmapFactory.decodeStream(newurl.openConnection() .getInputStream());
profile_photo.setImageBitmap(mIcon_val);
More from
1) how-to-load-an-imageview-by-url-in-android.
2) android-make-an-image-at-a-url-equal-to-imageviews-image
Try the library SimpleDraweeView
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/badge_image"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
and now you can simply do:
final Uri uri = Uri.parse(post.getImageUrl());
Try this :
ImageView imageview = (ImageView)findViewById(R.id.your_imageview_id);
Bitmap bmp = BitmapFactory.decodeFile(new java.net.URL(your_url).openStream());
imageview.setImageBitmap(bmp);
You can also try this : Android-Universal-Image-Loader for efficiently loading your image from URL
easy way to use Aquery library it helps to get direct load image from url
AQuery aq=new AQuery(this); // intsialze aquery
aq.id(R.id.ImageView).image("http://www.vikispot.com/z/images/vikispot/android-w.png");
Using Glide library:
Glide.with(context)
.load(new File(url)
.diskCacheStrategy(DiskCacheStrategy.ALL)
.into(imageView);