2011-04-14 6 views

Répondre

0

Jouez avec l'exemple de code InputMethodManager

:

 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); 
     } 
Questions connexes