[AutoComplete1.java]

 @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.autocomplete_1);

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


static final String[] COUNTRIES = new String[] {
 "Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra",
 "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina",... }


[audocomplete_1.xml]

        <AutoCompleteTextView android:id="@+id/edit"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"/>


'old > API_Demo' 카테고리의 다른 글

View_AutoComplete_Scroll  (0) 2010.04.02
View_AutoComplete_ScreenBottom  (0) 2010.04.02
Views_Animation_Shake  (0) 2010.03.26
Views_Animation_Push  (0) 2010.03.26
Views_Animation_Interpolators  (0) 2010.03.26
Posted by jazzlife
,