Android button - How to set focusable to true and still accept onClick listener on first click?

后端 未结 3 1539
暗喜
暗喜 2021-01-01 23:34

UPDATE

I\'ve solved the clicking issue by removing the two focusable lines from the button style and using the onClick event handler to call r

3条回答
  •  北荒
    北荒 (楼主)
    2021-01-02 00:16

    You might need to use an OnFocusChangeListener and then check if the focus event happened when the screen was in touch mode: if it did then it was a user click, otherwise it was from the trackball/trackpad.

提交回复
热议问题