This question already has an answer here:
How to highlight menu item on selection, I tried modifying styles.xml with various attributes like colorPressedHighlight
, colorActivatedHighlight
, etc. Is there any way to keep the menu item focussed until other item is selected?
AndroidManifest.xml:
<style name="onPressedHighLight" parent="AppBaseTheme">
<item name="android:colorActivatedHighlight">@color/OnPressed</item>
</style>
<color name="OnPressed" parent="AppBaseTheme">#FF0000</color>
Activity file:
setTheme(R.style.onPressedHighLight);
Use selector for custom buttons. Search in google for more examples. Here is one.