public static final class ContactsContract.PinnedPositions extends Object
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.
Modifier and Type | Field and Description |
---|---|
static int |
DEMOTED
Value of pinned position for a contact that a user has indicated should be considered
of the lowest priority.
|
static String |
UNDEMOTE_METHOD
The method to invoke in order to undemote a formerly demoted contact.
|
static int |
UNPINNED
Default value for the pinned position of an unpinned contact.
|
Constructor and Description |
---|
PinnedPositions() |
Modifier and Type | Method and Description |
---|---|
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.
|
public static final String UNDEMOTE_METHOD
public static final int UNPINNED
public static final int DEMOTED
public static void undemote(ContentResolver contentResolver, long contactId)
contentResolver
- to perform the undemote operation on.contactId
- the id of the contact to undemote.public static void pin(ContentResolver contentResolver, long contactId, int pinnedPosition)
contentResolver
- to perform the pinning operation on.pinnedPosition
- the position to pin the contact at. To unpin a contact, use
UNPINNED
.