如何一次选择多个联系人? [英] How to select multiple contacts at a time?

查看:94
本文介绍了如何一次选择多个联系人?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我取回通讯录联系人到我的应用程序通过使用下列code:

I retrieve phonebook contacts to my application by using following code:

public void onCreate(Bundle savedInstanceState) 
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    Intent contactPickerIntent = new Intent(Intent.ACTION_PICK,  
                                            Contacts.CONTENT_URI);  
    startActivityForResult(contactPickerIntent, CONTACT_PICKER_RESULT);      
}

不过,我想选择多个联系人,并上传者到一个数据库。这是可能的,如果是这样我怎么能做到这一点?

But I want to select multiple contacts and upload those to a DB. Is this possible and if so how can I do this?

推荐答案

那么你可以直接查询内容提供商之间的内部活动,以便用户可以选择多个联系人。这可以通过使用接触合同来实现。欲了解更多信息,你可以看一下 API文档或本<一个href="http://www.app-solut.com/blog/2011/03/working-with-the-contactscontract-to-query-contacts-in-android/"相对=nofollow>教程博客帖子

Well you could query the content provider directly inside your activity so the user can select multiple contact. This can be achieved using the contacts contract. For more information you can look at the api documentation or this tutorial blog post

这篇关于如何一次选择多个联系人?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆