Code example for AutoCompleteTextView

Methods: setText, getVisibility, setVisibility

0
		 
		listaTipos.setAdapter(adaptador);
	} 
	 
	public void pulsaAtras(View view){
		if(textoBuscar.getVisibility() == View.GONE){
			finish();
		}else{ 
			restaurarIU(); 
		} 
	} 
	 
	public void pulsaBuscar(View view){
		botonBuscar.setVisibility(View.INVISIBLE);
		titleConsulta.setVisibility(View.GONE);		
		textoBuscar.setVisibility(View.VISIBLE);
		textoBuscar.setText("");
		textoBuscar.requestFocus();
 
		// AutoComplete 
		S.data_base.openR(); 
		String[] aditivos = S.data_base.consultaNombreNummeroAditivos();
		S.data_base.close(); 
		if(aditivos == null)
			aditivos = new String[0];
		ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line, aditivos);
		textoBuscar.setAdapter(adapter);
		textoBuscar.setThreshold(2);
	} 
	 
	public void restaurarIU(){ 
		botonBuscar.setVisibility(View.VISIBLE);
		titleConsulta.setVisibility(View.VISIBLE);
		textoBuscar.setVisibility(View.GONE);
		textoBuscar.setText("");
	} 
 
	@Override 
	public boolean onKey(View view, int keyCode, KeyEvent keyEvent) {