List of usage examples for android.content Context SEARCH_SERVICE
String SEARCH_SERVICE
To view the source code for android.content Context SEARCH_SERVICE.
Click Source Link
From source file:se.chalmers.watchme.activity.SearchableActivity.java
public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.activity_main, menu); /*/*ww w . j av a 2 s.c om*/ * It should not be possible to mail or sort in this activity */ MenuItem mailItem = menu.findItem(R.id.menu_send_email_button); mailItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER); MenuItem sortItem = menu.findItem(R.id.menu_sort_button); sortItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER); /* * Add necessary functionality for the search widget */ SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE); SearchView searchView = (SearchView) menu.findItem(R.id.menu_search_button).getActionView(); searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName())); searchView.setIconifiedByDefault(false); // Do not iconify the widget; // expand it by default return true; }
From source file:com.bdenney.locl.activity.NearbyActivity.java
@Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the options menu from XML MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.menu, menu); // Get the SearchView and set the searchable configuration SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE); SearchView searchView = (SearchView) menu.findItem(R.id.menu_search).getActionView(); // Assumes current activity is the searchable activity searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName())); searchView.setIconifiedByDefault(false); // Do not iconify the widget; expand it by default if (!TextUtils.isEmpty(getSearchTerm())) { final MenuItem item = menu.findItem(R.id.menu_search); if (item != null) { item.setVisible(false);/* w w w . j ava 2 s .c o m*/ } } return true; }
From source file:org.bwgz.quotation.activity.QuotationsActivity.java
public boolean onCreateOptionsMenu(final Menu menu) { Log.d(TAG, String.format("onCreateOptionsMenu - menu: %s", menu)); getMenuInflater().inflate(R.menu.options_menu, menu); SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE); SearchView searchView = (SearchView) menu.findItem(R.id.search).getActionView(); searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName())); searchView.setQueryHint(getString(R.string.search_keyword)); final ListView drawerView = (ListView) findViewById(R.id.drawer_view); DrawerAdapter adapter = new DrawerAdapter(getResources().getStringArray(R.array.quotations_drawer), 1); drawerView.setAdapter(adapter);//from ww w . jav a 2s . c o m drawerView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Log.d(TAG, String.format("drawer - onItemClick - parent: %s view: %s position: %d id: %d", parent, view, position, id)); if (id == 0) { drawerLayout.closeDrawer(drawerView); startActivity(new Intent(parent.getContext(), HomeActivity.class)); } } }); return true; }
From source file:de.aw.monma.hbci.FragmentHBCIBanken.java
/** * In der ActionBar die SearchView initialisieren */// w w w .j av a 2 s .c o m @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { inflater.inflate(R.menu.fragment_hbcibank, menu); SearchManager searchManager = (SearchManager) getActivity().getSystemService(Context.SEARCH_SERVICE); SearchView searchView = (SearchView) MenuItemCompat.getActionView(menu.findItem(R.id.menu_List_search)); searchView.setSearchableInfo(searchManager.getSearchableInfo(getActivity().getComponentName())); searchView.setOnQueryTextListener(this); super.onCreateOptionsMenu(menu, inflater); }
From source file:com.bukanir.android.activities.SearchActivity.java
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.search, menu); MenuItem searchItem = menu.findItem(R.id.action_search); SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE); SearchView searchView = (SearchView) MenuItemCompat.getActionView(searchItem); searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName())); searchView.setIconifiedByDefault(false); return true;//from w ww.j a v a 2 s.c om }
From source file:com.nachtimwald.android.serviceexplorer.MainActivity.java
@Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.menu_options, menu); SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE); SearchView searchView = (SearchView) menu.findItem(R.id.action_search).getActionView(); searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName())); searchView.setSubmitButtonEnabled(true); searchView.setOnQueryTextListener(this); return super.onCreateOptionsMenu(menu); }
From source file:com.example.android.drinkapp.activities.HomeBackupActivity.java
@Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.mainmenu, menu); SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE); //SearchView searchView = // (SearchView) menu.findItem(R.id.action_search).getActionView(); SearchView searchView = (SearchView) MenuItemCompat.getActionView(menu.findItem(R.id.action_search)); searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName())); return true;/*from w w w . j av a 2 s.co m*/ }
From source file:de.aw.monma.actions.FragmentPayeeListe.java
/** * In der ActionBar die SearchView initialisieren *//*from w w w.j ava2 s .c o m*/ @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { inflater.inflate(R.menu.fragment_wplist, menu); SearchManager searchManager = (SearchManager) getActivity().getSystemService(Context.SEARCH_SERVICE); SearchView searchView = (SearchView) MenuItemCompat.getActionView(menu.findItem(R.id.menu_List_search)); searchView.setSearchableInfo(searchManager.getSearchableInfo(getActivity().getComponentName())); searchView.setOnQueryTextListener(this); super.onCreateOptionsMenu(menu, inflater); }
From source file:com.raulh82vlc.MoviesFinder.ui.activities.MoviesListActivity.java
@Override protected void setToolbarInitialisation() { final ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setHomeButtonEnabled(false); actionBar.setDisplayHomeAsUpEnabled(false); }//from w w w . java 2 s . co m mToolbar.inflateMenu(R.menu.menu_search); SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE); // Get the SearchView and set the searchable configuration final MenuItem searchItem = mToolbar.getMenu().findItem(R.id.action_search); mToolbar.setFocusable(true); setSearchView(searchManager, searchItem); }
From source file:com.loserskater.suhidegui.PackageActivity.java
@Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.activity_menu, menu); SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE); SearchView searchView = (SearchView) menu.findItem(R.id.action_search).getActionView(); searchView.setOnQueryTextListener(this); searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName())); return true;//from w w w . ja va2 s . c o m }