Code example for AutoCompleteTextView

Methods: showDropDown

0
		//Listener for drop down button 
		dropDownButton.setOnClickListener(new OnClickListener() {
			@Override 
			public void onClick(View v) 
			{ 
				mTextView.showDropDown();
			} 
		}); 
		 
		this.addView(dropDownButton, new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
	} 
	 
	/** 
	 * Sets the item to be displayed  
	 */ 
	public void setSuggestionSource(String[] items) 
	{ 
		ArrayAdapter<String> adapter = new UnconditionalArrayAdapter<String>(this.getContext(),
				android.R.layout.simple_spinner_item, items);
		adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
		mTextView.setAdapter(adapter);