문제

I have a DrawerLayout that I use as Sliding Menu, currently i use the InputMethodManager to close the keyboard when the DrawerLayout is shown

        public void onDrawerOpened(View drawerView) {
            supportInvalidateOptionsMenu();

            // Hide Soft-Keyboard
            InputMethodManager imm = (InputMethodManager) MainActivity.this.getSystemService(Context.INPUT_METHOD_SERVICE);
            imm.hideSoftInputFromWindow(drawerView.getApplicationWindowToken(), 0);


        }

Is there anyway to keep the soft-keyboard open and show the DrawerLayout on top of it? so when the drawer layout is closed, the activity/soft-keyboard is still at the same state?

Thanks.

도움이 되었습니까?

해결책 2

I guess this is not possible.. but you can try..there may be a way.. but my idea is hide and show the keyboard when drawer open and close that may be possible rather than your idea..

다른 팁

Try this code:

((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)).toggleSoftInput
                (InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top