Domanda

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.

È stato utile?

Soluzione 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..

Altri suggerimenti

Try this code:

((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)).toggleSoftInput
                (InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY);
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top