Resolved Android 2.3 issues
This commit is contained in:
parent
3994d02ddf
commit
5fb6f376c0
@ -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(
|
||||
|
@ -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());
|
||||
|
@ -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);
|
||||
|
@ -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();
|
||||
|
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user