Chat Android SDK  5.1.1
com.twilio.chat.StatusListener Class Referenceabstract

Interface for a generic listener object. More...

Public Member Functions

abstract void onSuccess ()
 Callback to report success status of an asynchronous call to the back end.
 
void onError (ErrorInfo errorInfo)
 Callback to report error status of an asynchronous call to the back end. More...
 

Detailed Description

Interface for a generic listener object.

This interface is implemented as an abstract class with already defined (empty) body for onError(). You are only required to define onSuccess().

Status listeners are always called on the originating thread or on main UI thread if the originating thread did not have a Looper.

You could wrap your call in a Handler invocation with a specific thread e.g.

Handler handler = new Handler(someOtherThreadLooper);
handler.post(new Runnable() {
@Override
public void run() {
client.getChannels().getUserChannelsList(myListener);
}
});

Then myListener will be invoked on someOtherThread. Note that your thread has to have an event Looper to be able to run callbacks.

Member Function Documentation

void com.twilio.chat.StatusListener.onError ( ErrorInfo  errorInfo)

Callback to report error status of an asynchronous call to the back end.

Parameters
errorInfoObject containing error information.