You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead, the notification shows up after you have paused it, presumably because showNotification() is placed in onPlayerStateChanged().
Then the notification disappears after completing a question. It will only reappear after pressing pause again in the next question. This behaviour probably occurs because the activity is finished and recreated with each next question.
Not sure where showNotification() should be placed instead to address these issues.
The text was updated successfully, but these errors were encountered:
fullmers
changed the title
notification does not show when the music starts playing
notification does not show when expected
Feb 2, 2018
I call showMediaNotification() after mMediaSession.setPlaybackState() inside initMediaSession() to fix this.
But this is not the only problem with notifications. Notification re-appears after cancelled when returning to main activity, because mNotificationManager.cancelAll() must be called AFTER stopPlayer() completes. Otherwise we cancel notification, then call player.stop and this causes state change along with new notification.
Additionally, I had to call initMediaSession() from within initializePlayer() jsut BEFORE mPlayer.addListener() because sometimes callback was called when no mMediaSession or mStateBuilder was created causing crash.
Instead, the notification shows up after you have paused it, presumably because showNotification() is placed in onPlayerStateChanged().
Then the notification disappears after completing a question. It will only reappear after pressing pause again in the next question. This behaviour probably occurs because the activity is finished and recreated with each next question.
Not sure where showNotification() should be placed instead to address these issues.
The text was updated successfully, but these errors were encountered: