From 7a5c721bfa1968d92ee76f9632dde0dc8a6ae9f9 Mon Sep 17 00:00:00 2001 From: lado Date: Fri, 11 Nov 2011 14:49:05 +0100 Subject: npe from market --- .../bjusystems/vdrmanager/gui/BaseEventListActivity.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'vdrmanager/src/de') diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventListActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventListActivity.java index 454ae17..52be349 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventListActivity.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventListActivity.java @@ -61,6 +61,7 @@ public abstract class BaseEventListActivity extends protected List results = new ArrayList(); + @Override protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -185,7 +186,7 @@ public abstract class BaseEventListActivity extends final EventListItem item = adapter.getItem(info.position); MenuItem mi = menu.findItem(R.id.epg_item_menu_live_tv); - if (item.isLive()) { + if (item.isLive() && item.getStreamId() != null) { mi.setVisible(true); } else { mi.setVisible(false); @@ -207,6 +208,10 @@ public abstract class BaseEventListActivity extends // find and remember item final EventListItem item = adapter.getItem(position); + if(item.isHeader()){ + return; + } + prepareDetailsViewData(item); // show details @@ -308,12 +313,17 @@ public abstract class BaseEventListActivity extends } protected void sortItemsByTime(List result) { + sortItemsByTime(result, false); + } + protected void sortItemsByTime(List result, final boolean reverse) { final Comparator comparator = new Comparator() { public int compare(final Event item1, final Event item2) { int c = item1.getStart().compareTo(item2.getStart()); if (c != 0) { - return c; + if(reverse == false) + return c; + return -1 * c; } if (item1.getChannelNumber() == null && item2.getChannelNumber() == null) { -- cgit v1.2.3