开发者

How to disable the virtual key pad in Android?

开发者 https://www.devze.com 2023-02-19 04:57 出处:网络
I would like to disable the virtual key pad that appears when the focus falls on a edit text element.

I would like to disable the virtual key pad that appears when the focus falls on a edit text element.

I've tried it with the following code:

((EditText)findViewById(R.id.EditTextYears)).setOnTouchListener(new OnTouchListener() {
    @Override
    public boolean onT开发者_JS百科ouch(View v, MotionEvent event) {
        return false;
    }
});

This works partially. The virtual key pad doesn't appear, but I can't focus on the edit text element as well, which I need to be able to do.


probably this should help http://www.androidpeople.com/android-hide-virtual-keyboard-through-code/

0

精彩评论

暂无评论...
验证码 换一张
取 消