2011-04-14 103 views

回答

0

播放与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); 
     }