Androidの開発の入力方法を学習コール

方法(既に入力画面に表示されている場合は非表示になっている、そうでなければ示されています)

IMM InputMethodManager = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)。
imm.toggleSoftInput( 0、InputMethodManager.HIDE_NOT_ALWAYS)。

方法II(ソフトキーボード入力の観点から受け入れビュー、SHOW_FORCED強制表示を表します)

IMM InputMethodManager = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)。
imm.showSoftInput(ビュー、InputMethodManager.SHOW_FORCED)。
imm.hideSoftInputFromWindow(view.getWindowToken()、 0); // 强制隐藏键盘

自動ポップアップ入力方法

mCommentEdittext.setFocusable(真の); 
mCommentEdittext.setFocusableInTouchMode(真の); 
mCommentEdittext.requestFocus(); 
InputMethodManager inputManager = (InputMethodManager)mCommentEdittext.getContext()getSystemService(Context.INPUT_METHOD_SERVICE)。
inputManager.showSoftInput(mCommentEdittext、 0);

隠された、システムのデフォルトの入力メソッドを呼び出し

((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE))hideSoftInputFromWindow(WidgetSearchActivity。この.getCurrentFocus()getWindowToken()
      、InputMethodManager.HIDE_NOT_ALWAYS)。
WidgetSearchActivityは、現在の活動です

オープン入力方式のステータスを取得します。

IMM = InputMethodManager (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
 ブールいるisOpen imm.isActive =(); // いるisOpen戻りtrueの場合、入力開口

 

 

 

 

 

 

終わり

おすすめ

転載: www.cnblogs.com/guanxinjing/p/11076295.html