From 7619bc174a689bef2ca0904d7bc6f945c3fa2d07 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Sat, 4 Jan 2014 15:25:11 +0100 Subject: [PATCH] Fixed playback not working after activity resume. --- src/com/github/nutomic/controldlna/gui/RouteFragment.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/com/github/nutomic/controldlna/gui/RouteFragment.java b/src/com/github/nutomic/controldlna/gui/RouteFragment.java index d1c3e1c..d3e7192 100644 --- a/src/com/github/nutomic/controldlna/gui/RouteFragment.java +++ b/src/com/github/nutomic/controldlna/gui/RouteFragment.java @@ -234,8 +234,10 @@ public class RouteFragment extends MediaRouteDiscoveryFragment implements @Override public void onRouteAdded(MediaRouter router, RouteInfo route) { for (int i = 0; i < mRouteAdapter.getCount(); i++) { - if (mRouteAdapter.getItem(i).getId().equals(route.getId())) - return; + if (mRouteAdapter.getItem(i).getId().equals(route.getId())) { + mRouteAdapter.remove(mRouteAdapter.getItem(i)); + break; + } } mRouteAdapter.add(route); }