Code example for AutoCompleteTextView

Methods: getText, getWindowToken

0
		 
	} 
	 
	private void ocultarTeclado(){ 
		InputMethodManager imm = (InputMethodManager)getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
		imm.hideSoftInputFromWindow(autoCompleteTextView1.getWindowToken(), 0);
	} 
	 
	private void llenaAutoCompletado(){ 
		GestionBBDD ges = new GestionBBDD(getActivity());		
		series = new ArrayList<Serie>(); 
		series = ges.leeSeries("");
		 
		ArrayAdapter<Serie> adapter = new ArrayAdapter<Serie>(getActivity(), android.R.layout.simple_dropdown_item_1line, series);		
		autoCompleteTextView1.setAdapter(adapter);
		 
		//Aprovechamos y llenamos la lista 
		series_filtradas = series;
		llenaLista(); 
	} 
	 
	private void llenaLista(){ 
		if(series_filtradas.size() > 0){
			lista_buscador_series.setAdapter(new Adaptador_buscador_series(getActivity(), series_filtradas));
			lbl_sin_coincidencias.setVisibility(View.GONE);
			lista_buscador_series.setVisibility(View.VISIBLE);			
		}else{ 
			lista_buscador_series.setVisibility(View.GONE);
			lbl_sin_coincidencias.setVisibility(View.VISIBLE);
		} 
		 
		 
	} 
	 
	private void muestraResultados(){ 
		GestionBBDD ges = new GestionBBDD(getActivity());		
		series_filtradas = new ArrayList<Serie>(); 
		 
		String texto = autoCompleteTextView1.getText().toString();
		 
		series_filtradas = ges.leeSeries(texto);
		 
		llenaLista(); 
	}