2

I tried

imageView=(ImageView)view.findViewById(R.id.imageView);
Uri photoUrl = profile1.getPhotoUrl();
imageView.setImageURI(photoUrl);

But i dont see anything. I am getting url when i am printing it Thanks in advance

bhumika rijiya
  • 440
  • 1
  • 5
  • 42

2 Answers2

3

Try to use picasso for this:

 Picasso.with(context)
           .load(url)
           .placeholder(R.drawable.placeholder)
           .resize(imgWidth, imgHeight)
           .centerCrop()
           .into(image);
Amarjit
  • 4,327
  • 2
  • 34
  • 51
  • 1
    Same behavior / code with Glide (https://github.com/bumptech/glide) which which is promoted by Google. See the Paris DroidCon 2016 conference : https://youtu.be/04igNM9IpwE?t=33m26s comparing Picasso and Glide. – Täg Jul 27 '16 at 14:06
  • Yeah.. I heard a lot about glide. but did not use it.. I am planning to use this in my next assigment – Amarjit Jul 28 '16 at 04:09
2

Try this

Bitmap bitmap = BitmapFactory.decodeStream((InputStream)new URL("YOUR_URL").getContent());
imageView.setImageBitmap(bitmap);
Vinothkumar Nataraj
  • 588
  • 2
  • 7
  • 23