Observer

abstract class Observer
kotlin.Any
   ↳ androidx.room.InvalidationTracker.Observer

An observer that can listen for changes in the database.

Summary

Public constructors
<init>(tables: Array<String!>)

Observes the given list of tables.

Protected constructors
<init>(firstTable: String, vararg rest: String!)

Observes the given list of tables.

Public methods
abstract Unit

Called when one of the observed tables is invalidated in the database.

Public constructors

<init>

Observer(tables: Array<String!>)

Observes the given list of tables.

Parameters
tables Array<String!>: The list of tables to observe for changes.

Protected constructors

<init>

protected Observer(firstTable: String, vararg rest: String!)

Observes the given list of tables.

Parameters
firstTable String: The table name
rest String: More table names

Public methods

onInvalidated

abstract fun onInvalidated(tables: MutableSet<String!>): Unit

Called when one of the observed tables is invalidated in the database.

Parameters
tables MutableSet<String!>: A set of invalidated tables. This is useful when the observer targets multiple tables and want to know which table is invalidated.