You need android.permission.READ_CONTACTS in AndroidManifest.xml.

On Nov 14, 3:20 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Hi,all.
> I try to access Contacts data by using Content Providers,but there
> seems to be an error.
>
> source code:
>
> public class iContact extends Activity {
>         private Cursor cur;
>     /** Called when the activity is first created. */
>     @Override
>     public void onCreate(Bundle savedInstanceState) {
>         super.onCreate(savedInstanceState);
>         setContentView(R.layout.main);
>
>         Uri mContacts =Contacts.People.CONTENT_URI;
>         Cursor managedCursor=managedQuery
> (mContacts,null,null,null,null);
>     }
>
> }
>
> error code:
> The application iContacts
> (process com.adroid.iContact)
> has stopped unexpectedly;
> please try again.
>
> But if I change
> Uri mContacts =Contacts.People.CONTENT_URI;
> to
> Uri mContacts =MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
> The problem will disappear.
>
> Anyone has ideas?
> 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]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to