I have a button defined as shown below. When I want to disable it I use my_btn.setEnabled(false)
, but I would also like to grey it out. How can I do that?
You have to provide 3 or 4 states in your btn_defaut.xml
as a selector.
You will provide effect and background for the states accordingly.
Here is a detailed discussion: Standard Android Button with a different color