一、Android EditText默认不弹出输入法的办法:
1. 在AndroidManifest.xml中将需要默认隐藏键盘的Activity中添加属性即可(常用此方法)

1 2 android:windowSoftInputMode= "adjustUnspecified|stateHidden" android:configChanges= "orientation|keyboardHidden"

例如:

1 2 3 4 5 6             android:name= ".activity.CheckInfoActivity"             android:launchMode= "singleTask"             android:windowSoftInputMode= "adjustUnspecified|stateHidden"             android:configChanges= "orientation|keyboardHidden"             android:screenOrientation= "portrait" />

2.  让 EditText失去焦点,使用EditText的clearFocus方法

1 2 EditText edit = (EditText)findViewById(R.id.edit); edit.clearFocus();

3. 强制隐藏Android输入法窗口

1 2 3 EditText edit=(EditText)findViewById(R.id.edit); InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(edit.getWindowToken(), 0 );

更多相关文章

  1. Android(安卓)8.0 设置默认闹钟提示音或者默认通知提示音
  2. [RK3288][Android6.0] 调试笔记 --- 替换默认Launcher
  3. Android环形进度条(安卓默认形式)实例代码
  4. Android输入法的显示或隐藏
  5. android textview 自动链接网址 修改默认点击事件
  6. android 软键盘 InputMethodManager
  7. android 状态栏和导航栏(status and navigation bars)
  8. android中的状态栏
  9. android 隐藏虚拟按键

随机推荐

  1. android 之 handler
  2. xmlns:android="http://schemas.android.
  3. Android(安卓)4.0 SDK的离线方式安装
  4. Android(安卓)UI之对话框(dialog)
  5. 2011.06.29(2)——— android 完全退出
  6. Introduction to Model View Presenter o
  7. Android中的Environment.getExternalStor
  8. Android(安卓)进程生命周期(Process Life
  9. android http://dl-ssl.google.com/andro
  10. android am命令