search

Home  >  Q&A  >  body text

android - How to monitor the display and hiding of the full-screen soft keyboard when the screen is horizontal?

When the screen is displayed horizontally, the soft keyboard takes up the entire screen. Is there any way to monitor the display and hiding of the soft keyboard?

巴扎黑巴扎黑2777 days ago641

reply all(1)I'll reply

  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-16 13:27:24

    There is
    in activity

    @Override🎜
    public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
    }
    这个方法监听配置改变,也就是横竖屏切换,
     int requestedOrientation = getRequestedOrientation();
                if (requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) {
                    //隐藏软键盘
                }

    reply
    0
  • Cancelreply