Code example for SearchView

Methods: setBackgroundColorsetOnQueryTextListener

0
 
		MenuItem item = menu.add("Search");
		item.setIcon(android.R.drawable.ic_menu_search);
		item.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
 
		SearchView searchView = new SearchView(ContactSearchActivity.this);
		searchView.setOnQueryTextListener(this);
		// Suchfeld weiss faerben 
		searchView.setBackgroundColor(-1);
		item.setActionView(searchView);
 
		return true; 
 
	} 
	 
	@Override 
	public void onResume() { 
		super.onResume(); 
		String rawContacts = readFromFile(CONTACTS_FILE_NAME);
		contacts = makeContactList(rawContacts);
Stop searching for code, let great code find you!  Add Codota to your java IDE