Skip to content

Most visited

Recently visited

navigation

ContactsContract.PinnedPositions

public static final class ContactsContract.PinnedPositions
extends Object

java.lang.Object
   ↳ android.provider.ContactsContract.PinnedPositions


Contact-specific information about whether or not a contact has been pinned by the user at a particular position within the system contact application's user interface.

This pinning information can be used by individual applications to customize how they order particular pinned contacts. For example, a Dialer application could use pinned information to order user-pinned contacts in a top row of favorites.

It is possible for two or more contacts to occupy the same pinned position (due to aggregation and sync), so this pinning information should be used on a best-effort basis to order contacts in-application rather than an absolute guide on where a contact should be positioned. Contacts returned by the ContactsProvider will not be ordered based on this information, so it is up to the client application to reorder these contacts within their own UI adhering to (or ignoring as appropriate) information stored in the pinned column.

By default, unpinned contacts will have a pinned position of UNPINNED. Client-provided pinned positions can be positive integers that are greater than 1.

Summary

Constants

int DEMOTED

Value of pinned position for a contact that a user has indicated should be considered of the lowest priority.

int UNPINNED

Default value for the pinned position of an unpinned contact.

Public constructors

ContactsContract.PinnedPositions()

Public methods

static void pin(ContentResolver contentResolver, long contactId, int pinnedPosition)

Pins a contact at a provided position, or unpins a contact.

static void undemote(ContentResolver contentResolver, long contactId)

Undemotes a formerly demoted contact.

Inherited methods

From class java.lang.Object

Constants

DEMOTED

added in API level 21
int DEMOTED

Value of pinned position for a contact that a user has indicated should be considered of the lowest priority. It is up to the client application to determine how to present such a contact - for example all the way at the bottom of a contact list, or simply just hidden from view.

Constant Value: -1 (0xffffffff)

UNPINNED

added in API level 21
int UNPINNED

Default value for the pinned position of an unpinned contact.

Constant Value: 0 (0x00000000)

Public constructors

ContactsContract.PinnedPositions

added in API level 21
ContactsContract.PinnedPositions ()

Public methods

pin

added in API level 21
void pin (ContentResolver contentResolver, 
                long contactId, 
                int pinnedPosition)

Pins a contact at a provided position, or unpins a contact.

Parameters
contentResolver ContentResolver: to perform the pinning operation on.

contactId long

pinnedPosition int: the position to pin the contact at. To unpin a contact, use UNPINNED.

undemote

added in API level 21
void undemote (ContentResolver contentResolver, 
                long contactId)

Undemotes a formerly demoted contact. If the contact was not previously demoted, nothing will be done.

Parameters
contentResolver ContentResolver: to perform the undemote operation on.

contactId long: the id of the contact to undemote.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)