Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.
added in version 2.0.0
belongs to Maven artifact androidx.room:room-runtime:2.0.0-rc01

InvalidationTracker.Observer

public static abstract class InvalidationTracker.Observer
extends Object

java.lang.Object
   ↳ androidx.room.InvalidationTracker.Observer


An observer that can listen for changes in the database.

Summary

Public constructors

InvalidationTracker.Observer(String[] tables)

Observes the given list of tables.

Protected constructors

InvalidationTracker.Observer(String firstTable, String... rest)

Observes the given list of tables.

Public methods

abstract void onInvalidated(Set<String> tables)

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

Inherited methods

Public constructors

InvalidationTracker.Observer

added in version 2.0.0
public InvalidationTracker.Observer (String[] tables)

Observes the given list of tables.

Parameters
tables String: The list of tables to observe for changes.

Protected constructors

InvalidationTracker.Observer

added in version 2.0.0
protected InvalidationTracker.Observer (String firstTable, 
                String... rest)

Observes the given list of tables.

Parameters
firstTable String: The table name

rest String: More table names

Public methods

onInvalidated

added in version 2.0.0
public abstract void onInvalidated (Set<String> tables)

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

Parameters
tables Set: A set of invalidated tables. This is useful when the observer targets multiple tables and want to know which table is invalidated.