Answers for "android autocompletetextview with suggestions from a model"

3

autocompletetextview in android studio

public class CountriesActivity extends Activity {
     protected void onCreate(Bundle icicle) {
         super.onCreate(icicle);
         setContentView(R.layout.countries);

         ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
                 android.R.layout.simple_dropdown_item_1line, COUNTRIES);
         AutoCompleteTextView textView = (AutoCompleteTextView)
                 findViewById(R.id.countries_list);
         textView.setAdapter(adapter);
     }

     private static final String[] COUNTRIES = new String[] {
         "Belgium", "France", "Italy", "Germany", "Spain"
     };
 }
Posted by: Guest on October-24-2020

Code answers related to "android autocompletetextview with suggestions from a model"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language