如何导入从电话簿中的联系人到我们的应用程序 [英] How to import contacts from phonebook to our application
本文介绍了如何导入从电话簿中的联系人到我们的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我开发的Android应用程序,当过用户点击按钮,它应该显示从电话簿中的所有联系人,在一个table.How我可以实现它,任何一个可以帮助me.thanks提前
解决方案
意向意图=新的意图(Intent.ACTION_GET_CONTENT);
intent.setType(ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE);
startActivityForResult(意向,1);
使用这块code下button.setOnClick功能,您将获得在电话簿中的所有联系人的显示
I am developing the android application ,when ever user clicks on the button it should show all contacts from the phone book with in a table.How can i achieve it,any one can help me.thanks in advance
解决方案
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType(ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE);
startActivityForResult(intent, 1);
Use this piece of code under the button.setOnClick function you'll get the display of all the contacts in the phone book
这篇关于如何导入从电话簿中的联系人到我们的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文