views:

145

answers:

1

Hi all, I want to create a tab which contains a tab for viewing contact detail. Here is what i did:

    intent = new Intent(Intent.ACTION_VIEW, Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_URI, ""+contactId));
    nativeInfo = tabHost.newTabSpec("native info").setIndicator("N Info").setContent(intent);

It throw security exception.

I appreciate your help.

Thanks.

A: 

You need to add that permission to your manifest file, so that the user gets notified your app will read contacts when the app is installed.

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

Take a look at this: http://developer.android.com/guide/topics/manifest/manifest-intro.html#perms

Ricardo Villamil