开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜