onConfigurationChanged() not firing for keyboardHidden

前端 未结 1 858
伪装坚强ぢ
伪装坚强ぢ 2020-12-16 12:44

I\'ve followed the various questions and answers here to setup my Android activity to override the onConfigurationChanged() in order to execute logic when the s

相关标签:
1条回答
  • 2020-12-16 13:35

    No, onConfigurationChange() doesn't catch soft keyboard events: it's not a configuration change. The orientation change causes a new set of resources to be used (such as layout-land vs layout-port), which is the definition of a configuration change.

    So how to do it? Well, There's no event fired when the keyboard is shown, but you can detect when the keyboard causes your layout to be adjusted.

    See How to check visibility of software keyboard in Android? for the code.

    0 讨论(0)
提交回复
热议问题