public abstract class FindCallback<T extends AVObject> extends AVCallback<java.util.List<T>>
A FindCallback is used to run code after a AVQuery is used to fetch a list of AVObjects in a background thread.
The easiest way to use a FindCallback is through an anonymous inner class. Override the done function to specify what the callback should do after the fetch is complete. The done function will be run in the UI thread, while the fetch happens in a background thread. This ensures that the UI does not freeze while the fetch happens.
For example, this sample code fetches all objects of class "MyClass". It calls a different function depending on whether the fetch succeeded or not.
AVQuery构造器和说明 |
---|
FindCallback() |
限定符和类型 | 方法和说明 |
---|---|
abstract void |
done(java.util.List<T> avObjects,
AVException avException)
Override this function with the code you want to run after the fetch is complete.
|
internalDone, internalDone
public abstract void done(java.util.List<T> avObjects, AVException avException)
avObjects
- The objects matching the query, or null if it failed.avException
- The exception raised by the find, or null if it succeeded.Copyright © 2013 AVOS Systems Inc. All Rights Reserved.