AutoCompleteTextView не показывает выпадающие элементы

Мой XML:

<AutoCompleteTextView
        android:id="@+id/searchAutoCompleteTextView_feed"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:clickable="true"
        android:completionThreshold="2"
        android:hint="@string/search" />

МОЙ Java-код:

AutoCompleteTextView eT = (AutoCompleteTextView)findViewById(R.id.searchAutoCompleteTextView_feed);
eT.addTextChangedListener(this);
String[] sa = new String[]{"apple", "mango", "banana", "apple mango", "mango banana"};
ArrayAdapter<String> aAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_dropdown_item_1line, sa);
eT.setAdapter(aAdapter);

Это вообще не работает... я имею в виду, что он просто работает как EditTextView. Где я не прав??

полный код:

public class FeedListViewActivity extends ListActivity implements TextWatcher{


    private AutoCompleteTextView eT;

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.feed);

        eT = (AutoCompleteTextView) findViewById(R.id.searchAutoCompleteTextView_feed);
        eT.addTextChangedListener(this);

                    Thread thread = new Thread(null, loadMoreListItems);
                    thread.start();
    }

    private Runnable returnRes = new Runnable() {
        public void run() {

            //code for other purposes
        }
    };

    private Runnable loadMoreListItems = new Runnable() {
        public void run() {
            getProductNames();

            // Done! now continue on the UI thread
            runOnUiThread(returnRes);
        }
    };

    protected void getProductNames() {

            String[] sa = new String[]{"apple", "mango", "banana", "apple mango", "mango banana"};

            ArrayAdapter<String> aAdapter = new ArrayAdapter<String>(getApplicationContext(),
                    android.R.layout.simple_dropdown_item_1line, sa);
            eT.setAdapter(aAdapter);

    }

    public void afterTextChanged(Editable s) {
        // TODO Auto-generated method stub

    }

    public void beforeTextChanged(CharSequence s, int start, int count,
            int after) {
        // TODO Auto-generated method stub

    }

    public void onTextChanged(CharSequence s, int start, int before, int count) {
        // TODO Auto-generated method stub

    }
}
8
задан Housefly 25 May 2012 в 12:22
поделиться