标签:android 代码 java autocomple
博客:http://blog.csdn.net/muyang_ren
XML就不说了
Java代码
public class LoginActivity extends Activity {
private AutoCompleteTextView autoIpText;
private ArrayAdapter<String> arrayAdapter;
private List<String> IPs;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
IPs = new ArrayList();
IPs.add("192.168.7.106");//预览添加一个字符串
//事件源处理
autoIpText = (AutoCompleteTextView)findViewById(R.id.autoIpText);
//适配器设置
arrayAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,IPs);
autoIpText.setAdapter(arrayAdapter);
}
......
}
Android学习【AutoCompleteTextView】
标签:android 代码 java autocomple
原文地址:http://blog.csdn.net/muyang_ren/article/details/46592819