public abstract class

InvalidationTracker.Observer

extends java.lang.Object

 java.lang.Object

↳androidx.room.InvalidationTracker.Observer

Overview

An observer that can listen for changes in the database.

Summary

Constructors
publicObserver(java.lang.String tables[])

Observes the given list of tables and views.

protectedObserver(java.lang.String firstTable, java.lang.String rest[])

Observes the given list of tables and views.

Methods
public abstract voidonInvalidated(java.util.Set<java.lang.String> tables)

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

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

protected Observer(java.lang.String firstTable, java.lang.String rest[])

Observes the given list of tables and views.

Parameters:

firstTable: The name of the table or view.
rest: More names of tables or views.

public Observer(java.lang.String tables[])

Observes the given list of tables and views.

Parameters:

tables: The list of tables or views to observe for changes.

Methods

public abstract void onInvalidated(java.util.Set<java.lang.String> tables)

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

Parameters:

tables: A set of invalidated tables. This is useful when the observer targets multiple tables and you want to know which table is invalidated. This will be names of underlying tables when you are observing views.