如何在android上启动“查看联系人”活动?

时间:2010-05-20 09:02:09

标签: android contacts

我想创建一个标签,其中包含用于查看联系人详细信息的标签。这是我做的:

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

抛出安全例外。

感谢您的帮助。

感谢。

1 个答案:

答案 0 :(得分:3)

您需要将该权限添加到清单文件中,以便在安装应用程序时通知用户您的应用会读取联系人。

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

看看这个: http://developer.android.com/guide/topics/manifest/manifest-intro.html#perms