简体   繁体   English

如何使用Intent打开用户的个人资料联系人?

[英]How can I open the user's profile contact using an Intent?

I'd like to build an intent which opens the user's profile contact in the "Contacts" application. 我想建立一个意图,在“联系人”应用程序中打开用户的个人资料联系人。 I've read that the profile/me contact is always at position 0 but it doesn't work with the snippet I've built: 我了解到,个人资料/我的联系人始终位于位置0,但不适用于我构建的代码段:

new Intent(Intent.ACTION_VIEW).setData(Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_URI, "0"))

Could any of you tell me how I can resolve this? 谁能告诉我如何解决这个问题?

尝试改用ContactsContract.Profile.CONTENT_URI

查看QuickSettings.java Profile QuickSettings.java的源代码,我可以使用它:

new Intent(Intent.ACTION_VIEW).setData(ContactsContract.Profile.CONTENT_URI)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Intent Android中选择联系人后如何删除联系人 - how can i delete a contact after choosing it in my intent android 如何在RecyclerView.Adapter中打开片段以使用户转到其他用户配置文件 - How can I open a fragment in a RecyclerView.Adapter to let User go to other users profile 如何使用基于意图的URI打开Discord服务器邀请? - how can i open discord server invite with intent based URI? 如何打开用户的相机并将其打开,但不能在 Android Studio 上拍照 - How can I open a user's camera and have it open, but NOT to take a photo on Android Studio 如何以这样一种方式创建地图意图,即如果地图应用程序未安装在用户的设备上,那么它应该在浏览器中打开地图? - How to create maps intent in such a way that if maps app is not installed on user's device than it should open the maps in a browser? 如何发送带有android意图的附件的电子邮件? - How can I send an email with an attached file with android's intent? 我怎么不能用新信息更新我的用户资料? - how can't I update my user profile with new information? 开启联络人意向DISPLAY_NAME - Open contact intent DISPLAY_NAME 如何通过意图在电话中保存联系人? 还是使用Android Studio的东西? - How to save a contact in phone via intent? Or something using android studio? 如何使用Geckodriver保留Firefox配置文件的缓存? - How can I retain my Firefox profile's cache with Geckodriver?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM