我在这里制作了 MultiAutoCompleteTextView,我得到了多条字符串,我使用 string-array 收集了它们。我想将它们插入 MySql 数据库。
这是我的安卓代码:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_work_now);
String[] str = {"Andoid", "Jelly Bean", "Froyo",
"Ginger Bread", "Eclipse Indigo", "Eclipse Juno"};
MultiAutoCompleteTextView mt = (MultiAutoCompleteTextView)
findViewById(R.id.multiAutoCompleteTextView1);
mt.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
ArrayAdapter<String> adp = new ArrayAdapter<String>(this,android.R.layout.simple_dropdown_item_1line, str);
mt.setThreshold(1);
mt.setAdapter(adp);
}
@Override
public boolean onCreateOptionsMenu (Menu menu){
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
}