简体   繁体   中英

What to use instead of Contacts.Intents.UI.LIST_STARRED_ACTION to display starred contacts in com.android.contacts?

Currently, I use this:

startActivity(new Intent(Contacts.Intents.UI.LIST_STARRED_ACTION));

Works perfectly, but Android Studio displays:

'LIST_STARRED_ACTION' is deprecated as of API 5: Android 2.0 (Eclair)

How to implement the same functionality (opening com.android.contacts displaying the starred contacts) without using deprecated code?

You can try this: new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI) It open contact book to pick contact. you can use startActivityForResult() or startActivity()

NB It is only show whole contact list.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM