在有些应用和场景中,需要屏蔽软件盘,有如下两种方法

1

View v = findViewById(R.id.myView);
比如找出的View为fEmail,则
InputMethodManager imm = (InputMethodManager)this.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(fEmail.getWindowToken(), 0);
其中this.getSystemService最好改为:
YourActivityClassName.this.getSystemService
2 配置文件中搞
  <activity
android:name=".activities.MyActivity"
android:configChanges="keyboardHidden" />

相关文章:

  • 2022-01-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-13
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-19
  • 2022-02-09
  • 2022-12-23
  • 2022-12-23
  • 2021-12-31
  • 2022-12-23
相关资源
相似解决方案