最终线性布局 l = (LinearLayout) findViewById(R.id.linearlist); public void onTextChanged(CharSequence s, int start, int before, int count) { textlength = et.getText().length(); array_sort.clear(); for (i = 0; i < namelist.length; i++) {
if (textlength <= namelist[i].length()) {
if (et.getText()
.toString()
.equalsIgnoreCase(
(String) namelist[i].subSequence(0,
textlength))) {
array_sort.add(namelist[i]);
if (et.getText().length() == 0) {
// array_sort.remove(namelist[i]);
array_sort.clear();