Fixed playback not working after activity resume.

This commit is contained in:
Felix Ableitner 2014-01-04 15:25:11 +01:00
parent 002934b2a1
commit 7619bc174a

View file

@ -234,8 +234,10 @@ public class RouteFragment extends MediaRouteDiscoveryFragment implements
@Override @Override
public void onRouteAdded(MediaRouter router, RouteInfo route) { public void onRouteAdded(MediaRouter router, RouteInfo route) {
for (int i = 0; i < mRouteAdapter.getCount(); i++) { for (int i = 0; i < mRouteAdapter.getCount(); i++) {
if (mRouteAdapter.getItem(i).getId().equals(route.getId())) if (mRouteAdapter.getItem(i).getId().equals(route.getId())) {
return; mRouteAdapter.remove(mRouteAdapter.getItem(i));
break;
}
} }
mRouteAdapter.add(route); mRouteAdapter.add(route);
} }