Code example for SearchView

Methods: onActionViewCollapsed

0
				Toast.makeText(MainActivity.this, query, Toast.LENGTH_SHORT).show();
				 
				InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
				imm.hideSoftInputFromWindow(MainActivity.this.getCurrentFocus().getWindowToken(), 0);
 
				sv.onActionViewCollapsed();
 
		    	return true; 
		    } 
		}); 
 
		Tab tab = actionBar
				.newTab()
				.setText("First tab")
				.setIcon( R.drawable.action_help )
				.setTabListener( 
						new MyTabListener( new Fragment1())); 
		 
		actionBar.addTab(tab);
 
		tab = actionBar