package com.example.ccccc;import android.os.Bundle;import android.support.v7.app.ActionBarActivity;import android.widget.ArrayAdapter;import android.widget.AutoCompleteTextView;public class MainActivity extends ActionBarActivity { private AutoCompleteTextView acTextView; private String[] res={"zxc","zxv","zxb","asd","asf","asg"}; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); acTextView=(AutoCompleteTextView) findViewById(R.id.autoCompleteTextView1); ArrayAdapter<String>adapter=new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, res); acTextView.setAdapter(adapter); } }
添加回答
举报
0/150
提交
取消