1.
FLAG_ALT_FOCUSABLE_IM
2.
(如果输入法在窗口上已经显示,则隐藏,反之则显示)
3.AndroidMainFest
4. clearFocus
5. setInputType
阅读(614) | 评论(0) | 转发(0) |
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
- getWindow().addFlags(
- WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
-
- 源码注释:
-
- /** Window flag: invert the state of {@link #FLAG_NOT_FOCUSABLE} with
- * respect to how this window interacts with the current method. That
- * is, if FLAG_NOT_FOCUSABLE is set and this flag is set, then the
- * window will behave as if it needs to interact with the input method
- * and thus be placed behind/away from it; if FLAG_NOT_FOCUSABLE is
- * not set and this flag is set, then the window will behave as if it
- * doesn't need to interact with the input method and can be placed
- * to use more space and cover the input method.
- */
- public static final int FLAG_ALT_FOCUSABLE_IM = 0x00020000;
-
- 该方法会导致界面里面所有需要弹出软键盘的控件均无法显示软键盘。
- InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
- imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);
- <activity
- android:name=".RemoteCanvasActivity"
- android:configChanges="orientation|keyboardHidden"
- android:windowSoftInputMode="stateHidden|adjustResize" >
- <intent-filter>
- <action android:name="android.intent.action.VIEW" >
- </action>
- </intent-filter>
- <intent-filter>
- <action android:name="android.intent.action.VIEW" />
- <category android:name="android.intent.category.DEFAULT" />
- </intent-filter>
- </activity>
4. clearFocus
- editText.clearFocus();
5. setInputType
- editText.setInputType(InputType.TYPE_NULL);
相关热门文章
给主人留下些什么吧!~~
评论热议