1
Uri name=null;
           String []whereargs={"Sameer Ahmad"};
    name=Uri.withAppendedPath(People.CONTENT_URI,People.Phones.CONTENT_DIRECTORY);
    cv1.put(People.NAME,"Tofeeq Ahmad");
    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
Lucifer
  • 29,392
  • 25
  • 90
  • 143
Tofeeq Ahmad
  • 11,935
  • 4
  • 61
  • 87

1 Answers1

1

have you declared the necessary permission in your manifest?

<uses-permission android:name="android.permission.WRITE_CONTACTS" />
Mark Allison
  • 21,839
  • 8
  • 47
  • 46