com.parse
Class RefreshCallback
Object
com.parse.RefreshCallback
public abstract class RefreshCallback
- extends Object
A RefreshCallback is used to run code after refresh is used to update a
ParseObject
in a background thread.
The easiest way to use a RefreshCallback is through an anonymous inner class.
Override the done
function to specify what the callback should
do after the refresh is complete. The done
function will be run
in the UI thread, while the refresh happens in a background thread. This
ensures that the UI does not freeze while the refresh happens.
For example, this sample code refreshes an object of class
"MyClass"
and id myId
. It calls a different
function depending on whether the refresh succeeded or not.
object.refreshInBackground(new RefreshCallback() {
public void done(ParseObject object, ParseException e) {
if (e == null) {
objectWasRefreshedSuccessfully(object);
} else {
objectRefreshFailed();
}
}
});
Method Summary |
abstract void |
done(ParseObject object,
ParseException e)
Override this function with the code you want to run after the save is
complete. |
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RefreshCallback
public RefreshCallback()
done
public abstract void done(ParseObject object,
ParseException e)
- Override this function with the code you want to run after the save is
complete.
- Parameters:
e
- The exception raised by the save, or null if it succeeded.