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

后端 未结 7 1635
误落风尘
误落风尘 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 the soft keyboard showing, keeping the copy/paste and cursor functionality, just add this line in your activity:

    getWindow().setFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM,
        WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
    

提交回复
热议问题