0

final LinearLayout 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 に答える