How to start 'View Contact' Activity on android?
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.
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
精彩评论