Android - Listen to a disabled button

前端 未结 8 2171
一整个雨季
一整个雨季 2021-01-17 08:56

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

8条回答
  •  无人及你
    2021-01-17 09:02

    I'm about to tackle this by using the selected state, which is generally available for use in widgets, and can be used in state list drawables. A simple search for usage of isSelected turns up results in ListView, GridView, TextView and TabLayout. And the documentation states

    Views are typically * selected in the context of an AdapterView like ListView or GridView; * the selected view is the view that is highlighted.

提交回复
热议问题