开发者

Can not update contact using ContentProvoider

Uri name=null;
           String []whereargs={"Sameer Ahmad"};
    name=Uri.withAppendedPath(People.CONTENT_URI,People.Phones.CONTENT_DIRECTORY);
    cv1.put(People.NAME,"Tofeeq Ahma开发者_如何学God");
    int i1=0;
    i1=getContentResolver().update(name,cv1,"name=?",whereargs);
    }
    catch(Exception e){
        e.getMessage();

I am trying to update a phone numder by URi but its showing the Exception:Cannot Update//Contacts/people/phone.Same error in inserting.

  1. I want to create shared data base which will be accessible from every application


have you declared the necessary permission in your manifest?

<uses-permission android:name="android.permission.WRITE_CONTACTS" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜