LocusIdCompat

Added in 1.5.0

class LocusIdCompat


An identifier for an unique state (locus) in the application. Should be stable across reboots and backup / restore.

Locus is a new concept introduced on Android Q and it lets the intelligence service provided by the Android system correlate state between different subsystems such as content capture, shortcuts, and notifications.

For example, if your app provides an activity representing a chat between 2 users (say A and B, this chat state could be represented by:

LocusIdCompat chatId = new LocusIdCompat("Chat_A_B");

And then you should use that chatId by:

NOTE: The LocusId is only used by a on-device intelligence service provided by the Android System, see android.view.contentcapture.ContentCaptureManager for more details.

Summary

Public constructors

Construct a new LocusIdCompat with the specified id.

Public functions

Boolean
equals(obj: Any?)
String

Gets the canonical id associated with the locus.

Int
LocusId
@RequiresApi(value = 29)
toLocusId()
java-static LocusIdCompat
@RequiresApi(value = 29)
toLocusIdCompat(locusId: LocusId)

Returns an instance of LocusIdCompat from given LocusId.

String

Public constructors

LocusIdCompat

Added in 1.5.0
LocusIdCompat(id: String)

Construct a new LocusIdCompat with the specified id.

Throws
java.lang.IllegalArgumentException

if id is empty or null.

Public functions

equals

fun equals(obj: Any?): Boolean

getId

Added in 1.5.0
fun getId(): String

Gets the canonical id associated with the locus.

hashCode

fun hashCode(): Int

toLocusId

Added in 1.5.0
@RequiresApi(value = 29)
fun toLocusId(): LocusId
Returns
LocusId

LocusId object from this compat object.

toLocusIdCompat

Added in 1.5.0
@RequiresApi(value = 29)
java-static fun toLocusIdCompat(locusId: LocusId): LocusIdCompat

Returns an instance of LocusIdCompat from given LocusId.

toString

fun toString(): String