AutoCompleteTextView setAdapter - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for AutoCompleteTextView setAdapter method.

This code example shows how to use the following methods:setOnKeyListener, setAdapter, setOnItemClickListener, setThreshold, addTextChangedListener
	public StationSelectorAdapter( Context context, AutoCompleteTextView view, StationSearchService service, List<Station> history, ChangeListener listener ) {
		this.context = context;
		this.listener = listener;
		this.history = history;
 
		view.setAdapter( new StationsAdapter( context, service, history ) );
		view.setMaxLines( 1 );
		view.setThreshold( 1 );
		view.addTextChangedListener( this );
		view.setOnItemClickListener( this );
		view.setOnKeyListener( this );
	} 
 
	@Override 
	public void afterTextChanged( Editable paramEditable ) {
		station = null;
		listener.stationChanged();
	} 
 
	@Override 
5
CodeRank
This code example shows how to use the following methods:setAdapter, setOnItemClickListener
 
    @Override 
    public void onResume() { 
        super.onResume(); 
        if (App.getUser().isSearchSuggestionsEnabled()) { 
            searchField.setAdapter(suggestionHelper.getAdapter());
            searchField.setOnItemClickListener(this);
        } else { 
            searchField.setAdapter(suggestionHelper.getEmptyAdapter());
        } 
    } 
 
    @Override 
    public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
        if (v.getId() == R.id.query_input && actionId == EditorInfo.IME_NULL) {
            startSearch(); 
        } 
        return false; 
    } 
 
6
CodeRank
This code example shows how to use the following methods:requestFocus, setVisibility, setAdapter, setThreshold, setText
	} 
	 
	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);
	} 
	 

6
CodeRank
This code example shows how to use the following methods:getAdapter, isPopupShowing, setAdapter, getText
        mFilterAdapter.onClick(view);
    } 
 
    @Override 
    public void onClick(View v) {
        if (mAutoCompleteTextView != null && !mAutoCompleteTextView.isPopupShowing()) {
            filterOnString(mAutoCompleteTextView.getText().toString());
        } 
    } 
 
    // This method will set the adapter if no adapter has been set.  The adapter is initialized 
    // here to prevent the drop-down from appearing uninvited on orientation change, as the 
    // AutoCompleteTextView.setText() will trigger the drop-down if the adapter has been set. 
    private void filterOnString(String string) {
        if (mAutoCompleteTextView.getAdapter() == null) {
            mAutoCompleteTextView.setAdapter(mFilterAdapter);
        } 
        mHideFilterSearchOnStart = false;
        mFilterAdapter.getFilter().filter(string);
    } 
} 
6
CodeRank
This code example shows how to use the following methods:setAdapter, setOnItemClickListener
			 
			public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
				// TODO Auto-generated method stub 
				if(isChecked){
					AlertDialog.Builder builder = new AlertDialog.Builder(StorybookActivity.this);
					final AutoCompleteTextView edchoose = new AutoCompleteTextView(StorybookActivity.this);
					final ArrayAdapter<String> aa = new ArrayAdapter<String>(StorybookActivity.this, android.R.layout.simple_dropdown_item_1line, GetLocsFromDb());
					edchoose.setAdapter(aa);
					edchoose.setOnItemClickListener(new AdapterView.OnItemClickListener() {
 
						public void onItemClick(AdapterView<?> arg0, View arg1,
								int arg2, long arg3) {
							// TODO Auto-generated method stub 
							String selected = (String) aa.getItem(arg2);
							edchoose.setText(selected);
							 
							 
						} 
					}); 
 

6
CodeRank
This code example shows how to use the following methods:setOnFocusChangeListener, setAdapter
  } 
 
  @Override 
  protected View createView() {
    Activity context = ApplicationImpl.getContext();
    AutoCompleteTextView view = new AutoCompleteTextView(context);
    view.setAdapter(new EmailAddressAdapter(context));
 
    // Listen to focus changes 
    view.setOnFocusChangeListener(this);
 
    return view;
  } 
 
  // EmailPicker implementation 
 
  @Override 
  public void GotFocus() { 
    EventDispatcher.dispatchEvent(this, "GotFocus");
  } 
5
CodeRank
This code example shows how to use the following methods:setOnFocusChangeListener, setAdapter
    this.d.setOnFocusChangeListener(this.a);
    this.e.setOnFocusChangeListener(this.b);
    this.g.setOnCheckedChangeListener(new j(this));
    this.l.setOnClickListener(new k(this));
    this.f.setOnClickListener(new l(this));
    this.c.setOnFocusChangeListener(new m(this));
    String str = com.keniu.security.sync.l.b(this);
    if ((str != null) && (str.length() > 0))
    { 
      if (str.startsWith("+86"))
        str = str.substring(3);
      this.c.setAdapter(new ArrayAdapter(this, 17367050, new String[] { str }));
    } 
    getWindow().setSoftInputMode(3); 
  } 
 
  protected void onDestroy() 
  { 
    i.a(this, ">>>>> on destroy");
    this.o = null;
5
CodeRank
This code example shows how to use the following methods:setAdapter, getText
    	 date		   = (EditText)findViewById(R.id.date);
    	 search        = (Button)findViewById(R.id.search);
    } 
   //## This Method enable AutoTextView suggestion adapter  
    void initAction(){ 
    	 startLocation.setAdapter(new GoEuroSuggestionAdapter(this,startLocation.getText().toString(),lat,lon));
    	 endLocation.setAdapter(new GoEuroSuggestionAdapter(this,endLocation.getText().toString(),lat,lon));
    } 
   //## This Method get user current location   
    void currentLocation(){ 
    	location = new CurrentLocation(MainActivity.this);
    	 if(location.canGetLocation()){
             double latitude = location.getLatitude();
             double longitude = location.getLongitude();
             if(latitude!=0 && longitude!=0){
            	 lat=latitude;
            	 lon=longitude;
             } 
              
         }else{ 
4
CodeRank
This code example shows how to use the following methods:setAdapter, setThreshold
		String[] ingredientes = S.data_base.consultaNombreIngredientes();
		S.data_base.close(); 
		 
		// AutoComplete 
		ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line, ingredientes);
        final AutoCompleteTextView ingrediente = new AutoCompleteTextView(this);
        ingrediente.setAdapter(adapter);
        ingrediente.setThreshold(2);
		 
		AlertDialog.Builder alert = new AlertDialog.Builder(this);
		alert.setTitle(S.TITLE_AÑADIR_INGREDIENTE);
 
		// Set an EditText view to get user input 
		LinearLayout layout = new LinearLayout(this);
		layout.setOrientation(LinearLayout.VERTICAL);
		ingrediente.setHint(S.INGREDIENTE);
		layout.addView(ingrediente);
		 
		final EditText cantidad = new EditText(this);
		cantidad.setHint(S.CANTIDAD);
5
CodeRank
This code example shows how to use the following methods:setAdapter, setThreshold
 
	    protected void onPostExecute(String[] result) 
	    { 
	    	AutoCompleteTextView actv = ((AutoCompleteTextView) GotanDroidActivity.this.findViewById(viewId));
			ArrayAdapter<String> adapter = new ArrayAdapter<String>(GotanDroidActivity.this, android.R.layout.simple_dropdown_item_1line, result);
			actv.setThreshold(1);
			actv.setAdapter(adapter);			
	        super.onPostExecute(result);
	    } 
	} 
 
	private class ValueThread extends Thread {
 
		boolean enable = true;
		 
		@Override 
		public void run() { 
			 
			while(enable){
				try { 
4
CodeRank

Related AutoCompleteTextView setAdapter Questions & Answers:

setAdapter Method Overview
Changes the list of data used for auto completion.
See Code Examples for other Android AutoCompleteTextView Methods: