From 2f217dac3b2ace6aa4a3f73f41a65d0df9f06993 Mon Sep 17 00:00:00 2001 From: lado Date: Sun, 13 Nov 2011 01:31:03 +0100 Subject: fix bug with channel epg --- .../bjusystems/vdrmanager/gui/EventEpgListActivity.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/EventEpgListActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/EventEpgListActivity.java index 7264a77..1df7c29 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/EventEpgListActivity.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/EventEpgListActivity.java @@ -105,13 +105,20 @@ public class EventEpgListActivity extends BaseTimerEditActivity implements if (event == SvdrpEvent.CACHE_HIT || event == SvdrpEvent.FINISHED_SUCCESS) { ArrayList channels = ChannelClient.getChannels(); + currentChannel = getApp().getCurrentChannel(); + boolean found = false; + int count = 0; for (final Channel c : channels) { channelSpinnerAdapter.add(c); + if(currentChannel != null && !found){ + if(currentChannel.equals(c)){ + found = true; + } else { + count++; + } + } } - currentChannel = getApp().getCurrentChannel(); - if(currentChannel != null){ - channelSpinner.setSelection(currentChannel.getNumber() - 1); - } + channelSpinner.setSelection(count); channelSpinner.setOnItemSelectedListener(EventEpgListActivity.this); } else { noConnection(event); -- cgit v1.2.3