コード例 #1
0
        public override void OnCreateOptionsMenu(IMenu menu, MenuInflater inflater)
        {
            inflater.Inflate(Resource.Menu.menu, menu);
            item = menu.FindItem(Resource.Id.action_search);
            var searchItem = Android.Support.V4.View.MenuItemCompat.GetActionView(item);

            searchView           = searchItem.JavaCast <SearchView>();
            searchView.QueryHint = "Search WeClip";
            searchView.Focusable = (false);
            searchView.SetQuery(query, false);
            searchView.Iconified = (false);
            searchView.RequestFocusFromTouch();
            searchView.SetOnQueryTextListener(this);
            if (query != null)
            {
                searchView.ClearFocus();
            }
        }