Please make sure that whenever you post a question regarding a force close,
you copy/paste the exception stack trace into the post and also mention what
environment you are using, what version of the SDK, what device.

On Wed, Feb 17, 2010 at 11:15 AM, LeGeNDuS <legen...@gmail.com> wrote:

> 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 <dplotni...@google.com> wrote:
> > Does your app request permission to write to contacts?
> >
> > On Feb 17, 2010 4:11 AM, "LeGeNDuS" <legen...@gmail.com> 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 android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com><android-developers%2Bunsubs
> cr...@googlegroups.com>
> > 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 android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to