Bug fix: menu didn't work on Android 2.x due to search widget

This commit is contained in:
Philipp Crocoll 2013-07-21 21:47:20 +02:00
parent c289346538
commit 58a6e63be0
2 changed files with 7 additions and 10 deletions

View File

@ -194,12 +194,13 @@ namespace keepass2android
MenuInflater inflater = MenuInflater; MenuInflater inflater = MenuInflater;
inflater.Inflate(Resource.Menu.group, menu); 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); searchView.SetSearchableInfo(searchManager.GetSearchableInfo(ComponentName));
var searchView = (SearchView)menu.FindItem(Resource.Id.menu_search).ActionView; }
searchView.SetSearchableInfo(searchManager.GetSearchableInfo(ComponentName));
return true; return true;
} }

View File

@ -30,11 +30,7 @@
android:showAsAction="ifRoom" android:showAsAction="ifRoom"
android:actionViewClass="android.widget.SearchView" android:actionViewClass="android.widget.SearchView"
/> />
<item android:id="@+id/menu_search_advanced"
android:icon="@android:drawable/ic_menu_search"
android:title="@string/menu_search_advanced"
android:showAsAction="never"
/>
<item android:id="@+id/menu_app_settings" <item android:id="@+id/menu_app_settings"
android:icon="@android:drawable/ic_menu_preferences" android:icon="@android:drawable/ic_menu_preferences"
android:title="@string/menu_app_settings" android:title="@string/menu_app_settings"