From 9bc05b12f5fcf9bbc7964628207bf512bc128761 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Sun, 4 May 2014 13:54:33 +0200 Subject: [PATCH] Improve wifi handling part two. If a route is removed, RouteFragment goes into deviceListMode. This change makes it go back into playlistMode if the route set in MediaRouterPlayService is added again. --- src/com/github/nutomic/controldlna/gui/RouteFragment.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/com/github/nutomic/controldlna/gui/RouteFragment.java b/src/com/github/nutomic/controldlna/gui/RouteFragment.java index fea4f51..9663922 100644 --- a/src/com/github/nutomic/controldlna/gui/RouteFragment.java +++ b/src/com/github/nutomic/controldlna/gui/RouteFragment.java @@ -244,6 +244,10 @@ OnSeekBarChangeListener, OnScrollListener { break; } mRouteAdapter.add(route); + + RouteInfo current = mMediaRouterPlayService.getCurrentRoute(); + if (current != null && route.getId().equals(current.getId())) + playlistMode(current); } @Override @@ -512,7 +516,7 @@ OnSeekBarChangeListener, OnScrollListener { changePlayPauseState(true); } else { Toast.makeText(getActivity(), R.string.select_route, Toast.LENGTH_SHORT) - .show(); + .show(); mStartPlayingOnSelect = start; } }