开发者

Open contact list to pick contact, or add a new one

开发者 https://www.devze.com 2023-03-05 14:00 出处:网络
In my application I need to pick a contact using the default contact application. I do that using: Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);

In my application I need to pick a contact using the default contact application. I do that using:

Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);

startActivityForResult(intent, PICK_CONTACT);

But i'm missing the "Create New" button, which is there on the top. How can开发者_开发问答 I get it?


You can't, this is not possible. The only way is to create yourself the "ContactPickerActivity" so you can add what you want in it and for example your "Add a contact" button.

In your sample folder (samples/android-XX/ApiDemos/src/com/example/android/apis/app/LoaderCursor) you have a great exemple of how to achieve it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号