diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2013-08-16 21:41:42 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2013-08-16 21:41:42 +0200 |
commit | 5fb6f376c06184fd0659bc25434afb2ceabb0e41 (patch) | |
tree | e76ffa908fa2c6ea850858a7bb9a5730ee99a0ce /src/de/danoeh/antennapod | |
parent | 3994d02ddfb52a4418951a22bb72f55f85a76fbb (diff) | |
download | AntennaPod-5fb6f376c06184fd0659bc25434afb2ceabb0e41.zip |
Resolved Android 2.3 issues
Diffstat (limited to 'src/de/danoeh/antennapod')
5 files changed, 19 insertions, 3 deletions
diff --git a/src/de/danoeh/antennapod/activity/FeedItemlistActivity.java b/src/de/danoeh/antennapod/activity/FeedItemlistActivity.java index ee4e39b9d..8fba44e5c 100644 --- a/src/de/danoeh/antennapod/activity/FeedItemlistActivity.java +++ b/src/de/danoeh/antennapod/activity/FeedItemlistActivity.java @@ -124,6 +124,8 @@ public class FeedItemlistActivity extends ActionBarActivity { SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE); SearchView searchView = (SearchView) MenuItemCompat.getActionView(menu.findItem(R.id.search_item)); + + searchView.setIconifiedByDefault(true); searchView.setSearchableInfo( diff --git a/src/de/danoeh/antennapod/activity/MainActivity.java b/src/de/danoeh/antennapod/activity/MainActivity.java index 447a436cf..4f25a07f1 100644 --- a/src/de/danoeh/antennapod/activity/MainActivity.java +++ b/src/de/danoeh/antennapod/activity/MainActivity.java @@ -183,7 +183,12 @@ public class MainActivity extends ActionBarActivity { SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE); - SearchView searchView = (SearchView) MenuItemCompat.getActionView(menu.findItem(R.id.search_item)); + MenuItem searchItem = menu.findItem(R.id.search_item); + SearchView searchView = (SearchView) MenuItemCompat.getActionView(searchItem); + if (searchView == null) { + MenuItemCompat.setActionView(searchItem, new SearchView(this)); + searchView = (SearchView) MenuItemCompat.getActionView(searchItem); + } searchView.setIconifiedByDefault(true); SearchableInfo info = searchManager.getSearchableInfo(getComponentName()); diff --git a/src/de/danoeh/antennapod/activity/SearchActivity.java b/src/de/danoeh/antennapod/activity/SearchActivity.java index 257ae86ae..29d55c102 100644 --- a/src/de/danoeh/antennapod/activity/SearchActivity.java +++ b/src/de/danoeh/antennapod/activity/SearchActivity.java @@ -154,7 +154,9 @@ public class SearchActivity extends ActionBarActivity implements AdapterView.OnI + " results"); searchAdapter.clear(); - searchAdapter.addAll(result); + for (SearchResult s : result) { + searchAdapter.add(s); + } searchAdapter.notifyDataSetChanged(); txtvStatus .setText(R.string.search_status_no_results); diff --git a/src/de/danoeh/antennapod/util/menuhandler/FeedItemMenuHandler.java b/src/de/danoeh/antennapod/util/menuhandler/FeedItemMenuHandler.java index aa029f672..fdd2011ae 100644 --- a/src/de/danoeh/antennapod/util/menuhandler/FeedItemMenuHandler.java +++ b/src/de/danoeh/antennapod/util/menuhandler/FeedItemMenuHandler.java @@ -51,10 +51,13 @@ public class FeedItemMenuHandler { * parameter should be set to false if the menu space is limited. * @param queueAccess * Used for testing if the queue contains the selected item - * @return Always returns true + * @return Returns true if selectedItem is not null. * */ public static boolean onPrepareMenu(MenuInterface mi, FeedItem selectedItem, boolean showExtendedMenu, QueueAccess queueAccess) { + if (selectedItem == null) { + return false; + } DownloadRequester requester = DownloadRequester.getInstance(); boolean hasMedia = selectedItem.getMedia() != null; boolean downloaded = hasMedia && selectedItem.getMedia().isDownloaded(); diff --git a/src/de/danoeh/antennapod/util/menuhandler/FeedMenuHandler.java b/src/de/danoeh/antennapod/util/menuhandler/FeedMenuHandler.java index 843607617..446e024d9 100644 --- a/src/de/danoeh/antennapod/util/menuhandler/FeedMenuHandler.java +++ b/src/de/danoeh/antennapod/util/menuhandler/FeedMenuHandler.java @@ -30,6 +30,10 @@ public class FeedMenuHandler { } public static boolean onPrepareOptionsMenu(Menu menu, Feed selectedFeed) { + if (selectedFeed == null) { + return false; + } + if (AppConfig.DEBUG) Log.d(TAG, "Preparing options menu"); menu.findItem(R.id.mark_all_read_item).setVisible( |