Defines the protocol for receiving information about changes in the state of the StreamLink connection, the data services available from the Liberator, and the DataSources that are normally connected to the Liberator.
More...
Defines the protocol for receiving information about changes in the state of the StreamLink connection, the data services available from the Liberator, and the DataSources that are normally connected to the Liberator.
You should implement this protocol if your application needs to take particular actions when such state changes occur.
Your application should not call into StreamLink when the connection status changes; StreamLink manages the connection state and will recover the connection to the Liberator without your application intervening.
- Note
- Your application may need to update the GUI using the information received by one or more of SLConnectionListener's callback methods. However, these callback methods are called on an anonymous thread, and updates to the GUI should not be attempted from this thread; GUI updates must only be performed on the GUI thread.
A simple solution is to wrap your implementation of SLConnectionListener in an instance of the SLConnectionListenerWrapper class, and then supply this wrapped implementation to StreamLink.addConnectionListener(). The wrapper ensures that GUI updates in the SLConnectionListener methods are performed in the GUI thread.
However, if application performance is a priority, you may need to handle the GUI thread processing directly in your implementation of SLConnectionListener.
- See also
- SLConnectionListenerWrapper