From 34137c051e082d913cab0596bc06201884a56b45 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Sun, 4 May 2014 13:42:08 +0200 Subject: [PATCH] Improve wifi-handling part one. If a route is removed, the notification is also removed. This re-creates the notification if the route is added again. --- .../mediarouter/MediaRouterPlayService.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/com/github/nutomic/controldlna/mediarouter/MediaRouterPlayService.java b/src/com/github/nutomic/controldlna/mediarouter/MediaRouterPlayService.java index 5d64d0b..d9e31fb 100644 --- a/src/com/github/nutomic/controldlna/mediarouter/MediaRouterPlayService.java +++ b/src/com/github/nutomic/controldlna/mediarouter/MediaRouterPlayService.java @@ -126,7 +126,16 @@ public class MediaRouterPlayService extends Service { if (!mBound && !mPollingStatus) stopSelf(); } - }; + + @Override + public void onRouteAdded(MediaRouter router, RouteInfo route) { + if (route.getId().equals(mCurrentRoute.getId())) { + selectRoute(route); + new CreateNotificationTask().execute(mPlaylist.get(mCurrentTrack) + .getFirstPropertyValue(DIDLObject.Property.UPNP.ALBUM_ART_URI.class)); + } + } + }; /** * Creates a notification after the icon bitmap is loaded.