I am trying to customize a selector for my AutoCompleteTextView so that when it is selected the color changes using. I am implementing android:dropDownSelector
. However it is not working and I get the default value....
aAdapterAutoComplete = new ArrayAdapter<String>(getActivity().getApplicationContext(), R.layout.auto_complete_text, suggest);
autoComplete.setAdapter(aAdapterAutoComplete);
layout:
<AutoCompleteTextView
android:id="@+id/autoCompleteTextView1"
style="@style/autocomplete_text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:dropDownSelector="@drawable/autocomplete_selector"
android:hint="@string/type_here_to_search"
android:imeOptions="actionSearch"
android:textSize="@dimen/text_size" >
<requestFocus />
</AutoCompleteTextView>
auto_complete_text:
<?xml version="1.0" encoding="utf-8"?><TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="@dimen/serach_bar_padding_top"
android:textSize="@dimen/text_size"
android:textColor="@color/text_color"
<?xml version="1.0" encoding="utf-8"?><selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_pressed="true"
android:drawable="@drawable/auto_select_color" />
<item
android:drawable="@drawable/auto_focused_color" />