Skip to content

Commit ae79762

Browse files
author
Chris Bellew
committed
[Wear] Remove title and subtitle when receiving playback information, in case media type was changed.
1 parent 65aa771 commit ae79762

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

wear/src/main/java/com/atomjack/wear/WearListenerService.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ public void onMessageReceived(MessageEvent messageEvent) {
106106
if(dataMap.getBoolean(WearConstants.LAUNCHED, false)) {
107107
finishMain();
108108
}
109+
// First, remove previous title and subtitle, if there are any
110+
nowPlayingMedia.remove(WearConstants.MEDIA_TITLE);
111+
nowPlayingMedia.remove(WearConstants.MEDIA_SUBTITLE);
109112
nowPlayingMedia = WearApplication.getInstance().nowPlayingMedia;
110113
nowPlayingMedia.putAll(dataMap);
111114
nowPlayingMedia.putString(WearConstants.PLAYBACK_STATE, message.equals(WearConstants.MEDIA_PLAYING) ? PlayerState.PLAYING.name() : PlayerState.PAUSED.name());

0 commit comments

Comments
 (0)