Disable soft-keyboard from EditText but still allow copy/paste?

后端 未结 7 1617
误落风尘
误落风尘 2020-11-28 06:39

Hi I\'m making custom dialer so I create my own input pad.

The problem is how do I disable the EditText but still allow cut/copy/paste?

相关标签:
7条回答
  • 2020-11-28 07:23

    To disable system keyboard automatic pop up for EditText or TextView do the following:

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        editTextView.setShowSoftInputOnFocus(false);
    } else {
        editTextView.setTextIsSelectable(true);
        //N.B. Accepting the case when non editable text will be selectable
    }
    
    0 讨论(0)
提交回复
热议问题