rawcontactid

How to set default image to Android phone contact that has no previous image

橙三吉。 提交于 2019-12-23 02:34:59
问题 I have a piece of code which updates the an Android contact´s image, the problem is that it doesn't work when the contact has no previous image. I also checked that the contact was from "Phone" account or "*@gmail.com" account. When it already has an image with these accounts I have no problem updating the image, the problem is just when the contact has no previous image assigned. Here is the method in charge of updating the image. public void update(long id, Bitmap bitmap) { ArrayList

Getting RawContact id using Contact id

半城伤御伤魂 提交于 2019-12-09 07:33:31
问题 I have built the following method to obtain the id from the RawContacts table using the id obtained from the Contacts table.This method fails thrwoing an Exception. public int getRawContactId(int contactId) { String[] projection=new String[]{ContactsContract.RawContacts._ID}; String selection=ContactsContract.RawContacts.CONTACT_ID+"=?"; String[] selectionArgs=new String[]{String.valueOf(contactId)}; Cursor c=context.getContentResolver().query(ContactsContract.RawContacts.CONTENT_URI

Getting RawContact id using Contact id

无人久伴 提交于 2019-12-03 08:46:42
I have built the following method to obtain the id from the RawContacts table using the id obtained from the Contacts table.This method fails thrwoing an Exception. public int getRawContactId(int contactId) { String[] projection=new String[]{ContactsContract.RawContacts._ID}; String selection=ContactsContract.RawContacts.CONTACT_ID+"=?"; String[] selectionArgs=new String[]{String.valueOf(contactId)}; Cursor c=context.getContentResolver().query(ContactsContract.RawContacts.CONTENT_URI,projection,selection,selectionArgs , null); int rawContactId=c.getInt(c.getColumnIndex(ContactsContract