0

I can't seem to find the resource on the device for the default contact image. I was only able to find this sdk/platforms/android-18/data/res/drawable-xhdpi/ic_contact_picture.png, however once I try using this photo and setting the contact photo in my code using this image (which I've added to /assets), the quality does not match the default on the device.

Could there possibly be a URI that has this image on the device already?

Patt Mehta
  • 4,110
  • 1
  • 23
  • 47

1 Answers1

1

In order to match different screen resolutions you need to use the MDPD / HDPI / XHDPI versions.

The easiest way is to copy the different versions of the images in the res/drawable-mdpi, res/drawable-hdpi and res/drawable-xhdpi folders of your project, using the same filename, ic_contact_picture (you will find them in the same path as you mention, only replacing "xhdpi"). You then refer to the image in your Java code as

R.drawable.ic_contact_picture

or in XML as

android:drawable="@drawable/ic_contact_picture"

This way, the system will automatically choose the version which matches your resolution.

Luis Mendo
  • 110,752
  • 13
  • 76
  • 147