Android 联系人选择器和搜索

发布于 2024-09-14 18:49:17 字数 339 浏览 4 评论 0原文

我有一个应用程序,允许用户使用类似于此的代码通过 ACTION_PICK Intent 选择联系人 示例

这工作正常,但用户可以按搜索键并从搜索结果中选择联系人。在这种情况下,选择器会显示联系人视图,其中唯一可用的操作是电子邮件、呼叫等。

我希望搜索到的联系人返回到调用活动,而不是显示联系人详细信息。这可能吗?

I have an app which allows the user to select a contact via an ACTION_PICK Intent using code similar to this example.

This works fine, but the user can press the Search key and choose a contact from the search results. In this case, the picker brings up the contact view where the only actions available are email, call, etc.

I'd expect the searched-for contact to be returned to the calling Activity instead of the displaying the contact details. Is this possible?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦途 2024-09-21 18:49:17

看看这个类:
http://developer.android.com/resources/samples/BusinessCard/src/com/example/android/businesscard/BusinessCardActivity.html

此处,当 ContactPickerActivity 返回时,将调用 loadContactInfo。其中调用了bindView(),它会显示详细信息视图。如果您不想显示详细信息视图,请跳过调用bindView()。直接使用 ContactInfo 信息。

Check out this class:
http://developer.android.com/resources/samples/BusinessCard/src/com/example/android/businesscard/BusinessCardActivity.html

Here when the ContactPickerActivity returns, loadContactInfo is called. In that bindView() is called which brings up the details view. If you dont want to show the details view, skip calling bindView(). Directly use the ContactInfo info.

我家小可爱 2024-09-21 18:49:17

当您触发意图时,请确保您使用的是 startActivityForResult() 不仅仅是 startActivity()。听起来这可能是你的问题

When you fire off the intent, make sure you are using startActivityForResult() not just startActivity(). It sounds like this may be your problem

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文