Esempio n. 1
0
        private void SetData(View rootView)
        {
            SearchManager searchManager = (SearchManager)Activity.GetSystemService(Android.Content.Context.SearchService);

            _searchView = rootView.FindViewById <SearchView>(Resource.Id.search);
            _searchView.SetSearchableInfo(searchManager.GetSearchableInfo(Activity.ComponentName));

            _searchView.SetIconifiedByDefault(false);
            _searchView.SetOnQueryTextListener(this);
            _searchView.SetOnCloseListener(this);
            _searchView.ClearFocus();

            Android.Views.InputMethods.InputMethodManager mgr = (Android.Views.InputMethods.InputMethodManager)Activity.GetSystemService(Android.Content.Context.InputMethodService);
            mgr.HideSoftInputFromWindow(_searchView.WindowToken, 0);
            SimpleSelectorItem[] items = (ParcableTest.Dialogs.SimpleSelectorItem[])Arguments.GetParcelableArray(ITEMS);

            _lvSelector = (ListView)rootView.FindViewById(Resource.Id.lvSelector);
            SimpleSelectorListAdapter adapter = new SimpleSelectorListAdapter(Activity, items.ToList());

            _lvSelector.Adapter = adapter;
        }