4

I am trying to get Contact default profile image in Android, in many Android devices the Contact profile default image path is

content://com.android.contacts/contacts/1209/photo

However, that path does not work on all devices. For example, in Samsung Galaxy S4 the above default image path is different.

I could not get a proper answer by searching. For example, a similar question "Retrieve System Default Android Contact Picture" does not address the problem I am facing.

In the following image there are two types of profile images, one is default and the second is custom:

profile images

So, how to get Contact profile default image path from every device?

Community
  • 1
  • 1
Ash
  • 671
  • 2
  • 7
  • 18
  • Have you checked it with cursor.getCount()>0 – Piyush Aug 01 '14 at 09:24
  • possible duplicate of [Using the system image for "no picture" contacts on Android](http://stackoverflow.com/questions/9366028/using-the-system-image-for-no-picture-contacts-on-android) – ozbek Aug 01 '14 at 10:10
  • check this http://developer.android.com/reference/android/provider/ContactsContract.Contacts.Photo.html and this http://thinkandroid.wordpress.com/2010/01/19/retrieving-contact-information-name-number-and-profile-picture/ – Randroid Aug 01 '14 at 11:16
  • http://stackoverflow.com/questions/3509178/getting-a-photo-from-a-contact check this – Randroid Aug 01 '14 at 11:30

1 Answers1

1

I have had the same problem in the past.The best and simple solution is to add your own default contact image to your application

edit:

it's quite simple search google for android default contact png image and add it to your drawable folder then use it in your contact layout with

    <QuickContactBadge
    android:id="@+id/contactavatar"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/defaultimage"/>
steveen zoleko
  • 395
  • 8
  • 23