Reputation: 671
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:
So, how to get Contact profile default image path from every device?
Upvotes: 4
Views: 2250
Reputation: 395
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"/>
Upvotes: 1