[Solved] How to set the text_selector at the run time

[ad_1]

put your selector under res/drawable and use

label.setTextColor(getResources().getColorStateList(R.drawable.text_selector));

don’t forget to set android:clickable="true" in the declaration of your TextView in the layout

3

[ad_2]

solved How to set the text_selector at the run time