0

I have an adapter which displays contact information. If a contact has a photo, it gets displayed, else the ic_launcher image is set as image

 if (contact.photoUri != null)
        holder.imageView.setImageURI(contact.photoUri);
    else
        holder.imageView.setImageResource(R.drawable.ic_launcher);

setImageUri works fine, but setImageResource(), setBackgroundResource() and setImageDrawable(context.getResources().getDrawable(R.drawable.ic_launcher)) are not displaying anything.

There is an error which I can´t reproduce, because this image works quite well on some other adapters of mine:

BitmapFactory﹕ Unable to decode stream: java.io.FileNotFoundException: /null: open failed: ENOENT (No such file or directory)
System.out﹕ resolveUri failed on bad bitmap uri: null

What is happening?

EDIT:

Even accessing the image via uri doesn´t work. it acts as the image does not exist :(

2.EDIT:

Now I´ve preset a default image via xml, but it isn´t working too!

Marian Klühspies
  • 15,824
  • 16
  • 93
  • 136

0 Answers0