2011-04-14 134 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); 
     }