Thanks...I have added this permission:
<uses-permission android:name="android.permission.WRITE_CONTACTS"/>
And now..it doens't stop, but I don't see the contact anywhere...
here's the code:
this one:
ContentValues values = new ContentValues();
values.put(People.NAME, etname.toString());
Uri uri = getContentResolver().insert(People.CONTENT_URI,
values);
Uri numberUri = Uri.withAppendedPath(uri,
People.Phones.CONTENT_DIRECTORY);
values.clear();
values.put(People.NUMBER, etphonenumber.toString());
getContentResolver().insert(numberUri, values);
other one, but this stops:
ContentValues values = new ContentValues();
values.put(People.NAME, etname.toString());
values.put(People.PRIMARY_EMAIL_ID, etemail.toString());
values.put(People.NUMBER, etphonenumber.toString());
Uri uri = getContentResolver().insert(People.CONTENT_URI,
values);
On 17 feb, 16:59, Dmitri Plotnikov <[email protected]> wrote:
> Does your app request permission to write to contacts?
>
> On Feb 17, 2010 4:11 AM, "LeGeNDuS" <[email protected]> wrote:
>
> Hello, I'm trying this code and it's getting stopped in the
> getContentResolver statement....
>
> ContentValues values = new ContentValues();
> values.put(People.NAME, "hola");
> Uri uri = getContentResolver().insert(People.CONTENT_URI,
> values);
>
> What am I doing bad?
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-developers%2Bunsubs
> [email protected]>
> For more options, visit this group
> athttp://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en