0

最终线性布局 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();
4

1 回答 1

0

只需即时实例化新的 TextView 并将它们添加到您的布局中。

TextView view = new TextView(context);
l.addView(view);
于 2012-07-25T20:34:23.213 回答