FANDOM


Is an interface for monitoring the state of a service


private ServiceConnection serviceConnection = new ServiceConnection() {

  public void onServiceConnected(ComponentName className, IBinder baBinder) {
    baService =
((BackgroundAudioService.BackgroundAudioServiceBinder)baBinder)
     .getService();
 }

  public void onServiceDisconnected(ComponentName className) {
    baService = null;
  }
};