How to do something after user clicks on my EditText

后端 未结 6 1844
庸人自扰
庸人自扰 2020-11-30 03:01

I have an EditText that shows time. After user clicks the EditText I want to show a TimePickerDialog, so I set a View.OnClickLis

6条回答
  •  盖世英雄少女心
    2020-11-30 03:23

    Unlike most other controls, EditTexts are focusable while the system is in 'touch mode'. The first click event focuses the control, while the second click event actually fires the OnClickListener. If you disable touch-mode focus with the android:focusableInTouchMode View attribute, the OnClickListener should fire as expected.

    
    

提交回复
热议问题