EditText onClickListener in Android

后端 未结 14 2143
时光取名叫无心
时光取名叫无心 2020-12-02 12:03

I want an EditText which creates a DatePicker when is pressed. So I write the following code:

    mEditInit = (EditText) findViewById(R.id.date_init);
    mE         


        
14条回答
  •  天涯浪人
    2020-12-02 12:32

    As Dillon Kearns suggested, setting focusable to false works fine. But if your goal is to cancel the keyboard when EditText is clicked, you might want to use:

    mEditText.setInputType(0);
    

提交回复
热议问题