Code example for SearchView

Methods: getQuery

0
			 
		} 
	}; 
 
	private void startActivity() { 
		if (search.getQuery().toString().length() >= 3){
			Intent i = new Intent(getSherlockActivity().getApplicationContext(),
					SearchCourseResultsActivity.class); 
			i.putExtra("search", search.getQuery().toString());
			startActivity(i);
		}else{ 
			Context context = getSherlockActivity().getApplicationContext();
			CharSequence text = "Search text length must be longer than 2 characters.";
			int duration = Toast.LENGTH_SHORT;
 
			Toast toast = Toast.makeText(context, text, duration);
			toast.show();
		} 
		 
	} 
Contextual code suggestions in your IDE  Get Codota for Java