How to check if Contact has Image?

Posted by Pentium10 on Stack Overflow See other posts from Stack Overflow or by Pentium10
Published on 2010-03-19T20:13:58Z Indexed on 2010/03/19 20:31 UTC
Read the original article Hit count: 114

Filed under:
|

I am assigning to an ImageView contacts images using this code:

mPhotoView = (ImageView) findViewById(R.id.photo);
mPhotoView.setImageURI(objItem.getPhotoUri());

If the contact has no image, this does nothing, and no error is raised.

When there is no image, I want to add a default image. So I need to check either if the image was added to the view, or check that the URI holds some image data

How do I achieve that?

Than I will set default image by this:

mPhotoView.setImageResource(R.drawable.ic_contact_picture_2);

© Stack Overflow or respective owner

Related posts about android

Related posts about android-sdk