public final class BriteContentResolver
extends java.lang.Object
ContentResolver
which allows for continuously observing
the result of a query. Create using a SqlBrite
instance.Modifier and Type | Method and Description |
---|---|
QueryObservable |
createQuery(android.net.Uri uri,
java.lang.String[] projection,
java.lang.String selection,
java.lang.String[] selectionArgs,
java.lang.String sortOrder,
boolean notifyForDescendents)
Create an observable which will notify subscribers with a query for
execution.
|
void |
setLoggingEnabled(boolean enabled)
Control whether debug logging is enabled.
|
public void setLoggingEnabled(boolean enabled)
public QueryObservable createQuery(android.net.Uri uri, java.lang.String[] projection, java.lang.String selection, java.lang.String[] selectionArgs, java.lang.String sortOrder, boolean notifyForDescendents)
Cursor
instance
returned from the SqlBrite.Query
.
Subscribers will receive an immediate notification for initial data as well as subsequent
notifications for when the supplied uri
's data changes. Unsubscribe when you no longer
want updates to a query.
Since content resolver triggers are inherently asynchronous, items emitted from the returned
observable use the Scheduler
supplied to SqlBrite.wrapContentProvider(android.content.ContentResolver, Scheduler)
. For
consistency, the immediate notification sent on subscribe also uses this scheduler. As such,
calling subscribeOn
on the returned observable has no effect.
Note: To skip the immediate notification and only receive subsequent notifications when data
has changed call skip(1)
on the returned observable.
Warning: this method does not perform the query! Only by subscribing to the returned
Observable
will the operation occur.
ContentResolver.query(Uri, String[], String, String[], String)
,
ContentResolver.registerContentObserver(Uri, boolean, ContentObserver)