Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Difference between AutoCompleteTextView and MultiAutoCompleteTextView

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 1.29k
    Comment on it

    In most of the applications user wants suggestions from a ListView/Source while typing in an editable text field. For that particular thing we have two different editable TextViews which provide a drop down menu.

    1. AutoCompleteTextView only offers the suggestions automatically about the whole sentence, from which user can easily choose a prefered item.

      //Initializing AutoCompleteTextView and ListView
      acTextView=(AutoCompleteTextView)findViewById(R.id.acTextView);
      lvListDisplay=(ListView)findViewById(R.id.lvListDisplay);
      
      
      //Adapter works as a communication channel between UI components and the datasource that fill data into the UI Components.
      final ArrayAdapter<String> adapter=new ArrayAdapter<String>(HomeScreenActivity.this,android.R.layout.simple_list_item_1,datasource);
          lvListDisplay.setAdapter(adapter);
          acTextView.setAdapter(adapter);
      acTextView.setThreshold(1);
      
    2. MultiAutoCompleteTextView make ease to the user by offering suggestion automatically for every token used in the sentence.

      //Initialize MultiAutoCompleteTextView
      macTextView=(MultiAutoCompleteTextView)findViewById(R.id.macTextView);
      
      
      //Finally attaching adapter to the MultiAutoCompleteTextView
          macTextView.setAdapter(adapter);
          macTextView.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
      macTextView.setThreshold(1);
      

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: