开发者

android:configChanges="keyboardHidden|orientation" Issue Android

开发者 https://www.devze.com 2023-03-21 23:04 出处:网络
Am using android:configChanges=\"keyboardHidden|orientation\"for switching between portrait and landscape modes. But when user opens softkeyboard in portrait and changes to lan开发者_JAVA技巧dscape ke

Am using android:configChanges="keyboardHidden|orientation"for switching between portrait and landscape modes. But when user opens softkeyboard in portrait and changes to lan开发者_JAVA技巧dscape keyboard should hide or dissappera but its not happening with that.


If you are intercepting orientation without overriding public void onConfigurationChanged(Configuration newConfig) in your Activity it is normal that the keyboard remains open.

You can either

  • override this method to reset the display

  • or avoid intercepting orientation to let the Activity restart (in which case your Activity will be reinitialized and onCreate() will be called again)


I'm not sure in it but I think that you need to write keyboardHidden|orientation|portrait (or landscape).

0

精彩评论

暂无评论...
验证码 换一张
取 消