1

How does android detects whether a keyboard is present or not? Which file I should modify if I need to change the way android detects the keyboard.

Mark Mooibroek
  • 7,636
  • 3
  • 32
  • 53

1 Answers1

0

Play with the InputMethodManager

Code sample:

        public void showKeyBoard() {
            InputMethodManager mgr = (InputMethodManager) mGap.getSystemService(Context.INPUT_METHOD_SERVICE);
            // only will trigger it if no physical keyboard is open
            mgr.showSoftInput(mAppView, InputMethodManager.SHOW_IMPLICIT);

            ((InputMethodManager) mGap.getSystemService(Context.INPUT_METHOD_SERVICE)).showSoftInput(mAppView, 0); 

        }

        public void hideKeyBoard() {
            InputMethodManager mgr = (InputMethodManager) mGap.getSystemService(Context.INPUT_METHOD_SERVICE);
            mgr.hideSoftInputFromWindow(mAppView.getWindowToken(), 0);
        }
Mark Mooibroek
  • 7,636
  • 3
  • 32
  • 53