For auto-complete content
The adaptive device can be used to display multiple lines of content
1 PackageCom.supermario.autocompletedemo;2 Importandroid.app.Activity;3 ImportAndroid.os.Bundle;4 ImportAndroid.widget.ArrayAdapter;5 ImportAndroid.widget.AutoCompleteTextView;6 Public classAutocompletedemoextendsActivity {7 //creates an array of strings to provide the data source for the adapter8String game[]=Newstring[]{"Game1", "gam2", "gamm3", "GAMEK3"};9 @OverrideTen Public voidonCreate (Bundle savedinstancestate) { One Super. OnCreate (savedinstancestate); A Setcontentview (r.layout.main); -Autocompletetextview auto=(Autocompletetextview) Findviewbyid (r.id.autocompletetextview1); - //absorb into the array adapter adapter, bind the data, set the interface to R.layout.list_view theArrayadapter<string> adapter=NewArrayadapter<string> ( This, r.layout.list_view,game); - //setting the adapter for Autocompletetextview - Auto.setadapter (adapter); - } +}Main
Android Note Autocompletetextview Day8