Closed teprinciple closed 4 years ago
锁屏页点击暂停时, MusicService中不应该 mediaSession.setActive(false) ,置为false将断开与锁屏页的连接。所以这里暂停时不应设置,停止才设置。
/** * 暂停或停止时回调 */ @Override public void onPlaybackStop() { mediaSession.setActive(false); mDelayedStopHandler.removeCallbacksAndMessages(null); mDelayedStopHandler.sendEmptyMessageDelayed(0, STOP_DELAY); stopForeground(true); }
最新版本已解决
锁屏页点击暂停时, MusicService中不应该 mediaSession.setActive(false) ,置为false将断开与锁屏页的连接。所以这里暂停时不应设置,停止才设置。