From 58a6e63be0daf7eb48cc5cf5cd2b27a18cafcdfc Mon Sep 17 00:00:00 2001 From: Philipp Crocoll Date: Sun, 21 Jul 2013 21:47:20 +0200 Subject: [PATCH] Bug fix: menu didn't work on Android 2.x due to search widget --- src/keepass2android/GroupBaseActivity.cs | 11 ++++++----- src/keepass2android/Resources/menu/group.xml | 6 +----- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/keepass2android/GroupBaseActivity.cs b/src/keepass2android/GroupBaseActivity.cs index 17f959b5..e4c8d296 100644 --- a/src/keepass2android/GroupBaseActivity.cs +++ b/src/keepass2android/GroupBaseActivity.cs @@ -194,12 +194,13 @@ namespace keepass2android MenuInflater inflater = MenuInflater; inflater.Inflate(Resource.Menu.group, menu); + if (Util.HasActionBar(this)) + { + var searchManager = (SearchManager) GetSystemService(Context.SearchService); + var searchView = (SearchView) menu.FindItem(Resource.Id.menu_search).ActionView; - var searchManager = (SearchManager)GetSystemService(Context.SearchService); - var searchView = (SearchView)menu.FindItem(Resource.Id.menu_search).ActionView; - - searchView.SetSearchableInfo(searchManager.GetSearchableInfo(ComponentName)); - + searchView.SetSearchableInfo(searchManager.GetSearchableInfo(ComponentName)); + } return true; } diff --git a/src/keepass2android/Resources/menu/group.xml b/src/keepass2android/Resources/menu/group.xml index 4a516d20..26788479 100644 --- a/src/keepass2android/Resources/menu/group.xml +++ b/src/keepass2android/Resources/menu/group.xml @@ -30,11 +30,7 @@ android:showAsAction="ifRoom" android:actionViewClass="android.widget.SearchView" /> - +