Activity启动edittext自动弹出软键盘解决办法 

1)在Manifest.xml文件中相应的activity下添加一下代码:


android:windowSoftInputMode="stateHidden"

2)EditText始终不弹出软键盘 


EditText edit=(EditText)findViewById(R.id.edit); 
edit.setInputType(InputType.TYPE_NULL);

3)在onCreate方法中加入以下代码使不弹出软件键盘 



getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);

4)


   InputMethodManager im = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
   im.hideSoftInputFromWindow(homepageLayout.getWindowToken(), 0);
   ——homepageLayout为当前视图

5)

//去虚拟输入栏

                InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);

                imm.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(),

                        InputMethodManager.HIDE_NOT_ALWAYS);