Search code examples
androidbuttonactionlistener

Android - Listen to a disabled button


How can I respond to an event based on clicking a disabled Button. I have a requirement that I have to present Dialog, when a disabled Button is clicked but the listener I have assigned does not fire even when I setClickable(false)

Am an android noob, sorry.


Solution

  • A disabled button cannot listen to any event, but you can customize your own button by extending Button class to make your own definition of disabling