Search in sources :

Example 1 with ServiceConnectionCallback

use of sugar.free.sightparser.handling.ServiceConnectionCallback in project SightRemote by TebbeUbben.

the class OngoingNotificationService method onCreate.

@Override
public void onCreate() {
    serviceConnector = new SightServiceConnector(this);
    serviceConnector.setConnectionCallback(new ServiceConnectionCallback() {

        @Override
        public void onServiceConnected() {
            statusChanged(serviceConnector.getStatus());
        }

        @Override
        public void onServiceDisconnected() {
            statusChanged(Status.DISCONNECTED);
        }
    });
    serviceConnector.addStatusCallback(this::statusChanged);
    serviceConnector.connectToService();
}
Also used : ServiceConnectionCallback(sugar.free.sightparser.handling.ServiceConnectionCallback) SightServiceConnector(sugar.free.sightparser.handling.SightServiceConnector)

Aggregations

ServiceConnectionCallback (sugar.free.sightparser.handling.ServiceConnectionCallback)1 SightServiceConnector (sugar.free.sightparser.handling.SightServiceConnector)1