How to import contacts from phonebook to our application

前端 未结 4 1518
长发绾君心
长发绾君心 2020-11-29 13:37

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

4条回答
  •  一个人的身影
    2020-11-29 14:03

                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

提交回复
热议问题