private void changeVolume() { if (currentVolume > MAX_VOLUME) { currentVolume = MAX_VOLUME; } if (currentVolume < MIN_VOLUME) { currentVolume = MIN_VOLUME; } player.changeVolume(currentVolume); saveVolume(); }
@Override public void onServiceConnected(ComponentName className, IBinder service) { PlayerService.LocalBinder binder = (PlayerService.LocalBinder) service; player = binder.getService(); changeVolume(); state = player.getState(); changeState(); bound = true; }