Search code examples
androidandroid-imageviewimageurl

How to use setImageURI() in android?


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


Solution

  • Try to use picasso for this:

     Picasso.with(context)
               .load(url)
               .placeholder(R.drawable.placeholder)
               .resize(imgWidth, imgHeight)
               .centerCrop()
               .into(image);