java.lang.Object | ||
↳ | java.util.Observable | |
↳ | android.content.ContentQueryMap |
Caches the contents of a cursor into a Map of String->ContentValues and optionally keeps the cache fresh by registering for updates on the content backing the cursor. The column of the database that is to be used as the key of the map is user-configurable, and the ContentValues contains all columns other than the one that is designated the key.
The cursor data is accessed by row key and column name via getValue().
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a ContentQueryMap that caches the content backing the cursor
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Access the ContentValues for the row specified by rowName
| |||||||||||
Requeries the cursor and reads the contents into the cache
| |||||||||||
Change whether or not the ContentQueryMap will register with the cursor's ContentProvider
for change notifications.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Is called before the object's memory is being reclaimed by the VM.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class java.util.Observable
| |||||||||||
From class java.lang.Object
|
Creates a ContentQueryMap that caches the content backing the cursor
cursor | the cursor whose contents should be cached |
---|---|
columnNameOfKey | the column that is to be used as the key of the values map |
keepUpdated | true if the cursor's ContentProvider should be monitored for changes and the map updated when changes do occur |
handlerForUpdateNotifications | the Handler that should be used to receive notifications of changes (if requested). Normally you pass null here, but if you know that the thread that is creating this isn't a thread that can receive messages then you can create your own handler and use that here. |
Access the ContentValues for the row specified by rowName
rowName | which row to read |
---|
Requeries the cursor and reads the contents into the cache
Change whether or not the ContentQueryMap will register with the cursor's ContentProvider for change notifications. If you use a ContentQueryMap in an activity you should call this with false in onPause(), which means you need to call it with true in onResume() if want it to be kept updated.
keepUpdated | if true the ContentQueryMap should be registered with the cursor's ContentProvider, false otherwise |
---|
Is called before the object's memory is being reclaimed by the VM. This can only happen once the VM has detected, during a run of the garbage collector, that the object is no longer reachable by any thread of the running application.
The method can be used to free system resources or perform other cleanup
before the object is garbage collected. The default implementation of the
method is empty, which is also expected by the VM, but subclasses can
override finalize()
as required. Uncaught exceptions which are
thrown during the execution of this method cause it to terminate
immediately but are otherwise ignored.
Note that the VM does guarantee that finalize()
is called at most
once for any object, but it doesn't guarantee when (if at all) finalize()
will be called. For example, object B's finalize()
can delay the execution of object A's finalize()
method and
therefore it can delay the reclamation of A's memory. To be safe, use a
ReferenceQueue, because it provides more control
over the way the VM deals with references during garbage collection.
Throwable |
---|