0
我已經編寫了使用內容提供程序編程更新我的聯繫人列表的代碼,只要我嘗試插入不更新的電話號碼,它顯示我參考了以前的電話號碼 我貼我已經寫我已經編寫了使用內容提供程序更新我的聯繫人但不更新我的聯繫人列表的代碼
private void updateContact(String phone) {
if (updateUri == null) {
Toast.makeText(NativeContentProvider.this, "There is nothing to update, Please create a contact and then click update", Toast.LENGTH_LONG).show();
} else {
ContentValues newPhone = new ContentValues();
newPhone.put(People.Phones.TYPE, People.TYPE_MOBILE);
newPhone.put(People.NUMBER, phone);
getContentResolver().update(updateUri, newPhone, null,null);
Toast.makeText(NativeContentProvider.this, "Updated the phone number to: " + phone, Toast.LENGTH_SHORT).show();
Log.i(getClass().getSimpleName(), "Updated the phone number");
}
}
我堅持
這是LOG 01-06 08:29:39.667中的值:DEBUG/NativeContentProvider(502):updateURI content:// contacts/people/128 /電話/ 674 – shvivek 2012-01-06 08:31:33