I have a grid view in my activity. I have set the item highlight color of the grid view with GridView.setSelector()
.
XML
<GridView
android:id="@+id/gridView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
android:background="#DDDDDD"
android:choiceMode="singleChoice"
android:columnWidth="@dimen/category_edit_grid_item_size"
android:numColumns="auto_fit"
android:stretchMode="columnWidth" />
Code
gridView.setSelector(R.color.theme_primary);
When I select an item, it gets highlighted in R.color.theme_primary
. But as soon as I move to another input element in the activity (say I touched on an edit text), the grid view highlight goes away.
How can I keep the highlight even after grid view looses focus?