Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - Update contact is not working using lookupUri

Update contact is not working using lookupUri

Put your problem here if it does not fit any of the other categories.

Update contact is not working using lookupUri

Postby twishadv » Mon Mar 14, 2011 8:30 am

I am trying to add and update contacts to the phone book through my application. I am using the lookup key to uniquely identify the contact before updating. Below is my code snippet for getting the unique contact to be updated:

Code: Select all
Uri lookupUri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_LOOKUP_URI, lookupKey);
Uri res = ContactsContract.Contacts.lookupContact(context.getContentResolver(), lookupUri);
Cursor t_cursor = context.getContentResolver().query(res, null, null, null, null);
String t_id = t_cursor.getString(t_cursor.getColumnIndex(ContactsContract.Contacts.Data._ID));
String t_contactId = t_cursor.getString(t_cursor.getColumnIndex(ContactsContract.Contacts._ID));


After obtaining the contact I am updating it as follows:

Code: Select all
            String Where = ContactsContract.Contacts.Data._ID + " = '"+t_id+"'";
//            String Where = ContactsContract.Contacts.Data._ID + " = '"+t_id+"' AND"+ContactsContract.Contacts._ID +" = '" +t_contactId+" '" ;
            ContentValues values = new ContentValues();
            values.put(ContactsContract.CommonDataKinds.StructuredName.DISPLAY_NAME, modified_name+"P");
            values.put(Email.TYPE, Email.TYPE_WORK);
            values.put(Email.DATA, email);
            values.put(Organization.TITLE, title);
            values.put(Organization.COMPANY, "XYZ");
            context.getContentResolver().update(Data.CONTENT_URI, values, Where, null);


But nothing is getting updated. It is not giving any error but still is not working. Could anyone suggest where am I going wrong ?
twishadv
Once Poster
Once Poster
 
Posts: 1
Joined: Mon Mar 14, 2011 8:19 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 24 guests