I would like to define a selector dynamically in java.
I use drawables from ressources and above I write some text. So, both normal drawable and drawable focus state cannot be defined into an xml file…
Is there a way to do this in Java?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Have you checked out StateListDrawable?
This is the type of drawable that will be created by your selector.
So you could do something like this: