public interface RefreshCallback
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(); } } });
Modifier and Type | Method and Description |
---|---|
void |
done(ParseObject object,
ParseException e)
Override this function with the code you want to run after the save is complete.
|
void done(ParseObject object, ParseException e)
object
- The object that was refreshed, or null
if it did not succeed.e
- The exception raised by the login, or null
if it succeeded.