Question

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.

Était-ce utile?

La solution 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..

Autres conseils

Try this code:

((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)).toggleSoftInput
                (InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY);
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top