bad bitmap error when setting Uri

Viewed 31833

I would like to make an ImageView display an image on a website. So I create a new ImageView and execute imgView.setImageURI(uri);

When I launch the app the image does not appear and I get the error, "resolveUri failed on bad Bitmap Uri (uri)".

Any ideas on how to solve this?

5 Answers

Glide is an awesome library for displaying images!

 Glide.with(context)
                    .load(uri)
                    .into(imageView);

Use library Picasso

Manifest

uses-permission android:name="android.permission.INTERNET"

build gradle

implementation 'com.squareup.picasso:picasso:2.71828'

Activity:

Picasso.get().load(photoUrl).into(imageView);

Related