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.52k
    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.

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

      1. //Initialize MultiAutoCompleteTextView
      2. macTextView=(MultiAutoCompleteTextView)findViewById(R.id.macTextView);
      3.  
      4.  
      5. //Finally attaching adapter to the MultiAutoCompleteTextView
      6. macTextView.setAdapter(adapter);
      7. macTextView.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
      8. macTextView.setThreshold(1);

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Reset Password
Fill out the form below and reset your password: