Code example for AutoCompleteTextView

Methods: setThreshold

0
		 
		// enable DropDown if manual user input 
		textViewCity.setOnTouchListener(new OnTouchListener() {
			@Override 
			public boolean onTouch(View v, MotionEvent event) {
				textViewCity.setThreshold(1);
				return false; 
			} 
		}); 
 
		// read city from phone DB 
		if (((CityDealsApplication) this.getApplication()).getCity() == null) {
			// get stored city from phone DB 
			DBService dbs = new DBService(this);
			putCategoriesInMemory(dbs.getCategories());
			String city = dbs.getStoredCity();
			dbs.closeDB();
 
			if (city != null && !city.equals("")) {
				textViewCity.setText(city);
				// disable DropDown