views:

166

answers:

1

Is it possible to have an EditTextPreference with AutoComplete attached to it?

I know ho to attach one to an element with an id, but am having trouble figure out how to attach the ArrayAdapter to the preference field.

This is wrong, but it's as close as I can get.

final String[] TEAMS = getResources().getStringArray(R.array.teams);   
AutoCompleteTextView EditTextPreference = (AutoCompleteTextView) findViewById(R.id.editTextPrefTeam);     
ArrayAdapter adapter = new ArrayAdapter(this, android.R.layout.simple_dropdown_item_1line, TEAMS);
EditTextPreference.setAdapter(adapter);
A: 

Probably if you subclass it and make your own view for that and use the AutoCompleteTextView object as element it will work, as currently I don't see how a simple EditText can be changed to autocomplete.

Pentium10