Package com.parse
Interface SendCallback
-
public interface SendCallback
ASendCallback
is used to run code after sending aParsePush
in a background thread.The easiest way to use a
SendCallback
is through an anonymous inner class. Override thedone
function to specify what the callback should do after the send is complete. Thedone
function will be run in the UI thread, while the send happens in a background thread. This ensures that the UI does not freeze while the send happens.For example, this sample code sends the message
"Hello world"
on the"hello"
channel and logs whether the send succeeded.ParsePush push = new ParsePush(); push.setChannel("hello"); push.setMessage("Hello world!"); push.sendInBackground(new SendCallback() { public void done(ParseException e) { if (e == null) { Log.d("push", "success!"); } else { Log.d("push", "failure"); } } });
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
done(ParseException e)
Override this function with the code you want to run after the send is complete.
-
-
-
Method Detail
-
done
void done(ParseException e)
Override this function with the code you want to run after the send is complete.- Parameters:
e
- The exception raised by the send, ornull
if it succeeded.
-
-