mirror of
https://github.com/moparisthebest/keepass2android
synced 2024-12-24 07:48:49 -05:00
Bug fix: menu didn't work on Android 2.x due to search widget
This commit is contained in:
parent
c289346538
commit
58a6e63be0
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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"
|
||||||
|
Loading…
Reference in New Issue
Block a user