Search code examples
androidimageviewpicasso

why some images showing blank/black in imageView


Why do some images show blank/black? These images are fetched from the server by Picasso library.

This is the screen shot

this is the screen shot

this is code

  Picasso.with(getApplicationContext()).load(profileModel.getDoc_pic()).into(docPic);

Solution

  • About Picasso

    Place Holders

    Picasso supports both download and error placeholders as optional features.

    you can use place holder and error for this purpose.

    Try :

    Picasso.with(getApplicationContext()).load(profileModel.getDoc_pic()).placeholder(R.drawable.tmp_image).error(R.drawable.tmp_image).into(docPic);
    

    In manifest need to add Internet permission :

    <uses-permission android:name="android.permission.INTERNET" />