gpt4 book ai didi

android - onConfigurationchanged 未通过 jellybean(4.2.1) 调用

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:57:52 25 4
gpt4 key购买 nike

我真的被这个问题困扰了。我已经设置了标志 android:configChanges="keyboardHidden|orientation|locale"

但是当我更改语言配置时,onconfigurationchanged 函数没有被调用。奇怪的是我的代码在其他 android 平台上运行良好。

我在这里搜索了这个问题。有人说我需要将 sdk 版本设置得低一些。但它没有用。

请给我一些提示。

最佳答案

如果您使用的是 API 17,请添加 layoutDirection 属性,例如 android:configChanges="keyboardHidden|orientation|locale|layoutDirection"

layoutDirection 在 API 17 中引入,它也与界面语言更改有关。Piece of android docs关于 android:configChanges 还不够明确,但至少我们有:

layoutDirection: The layout direction has changed. For example, changing from left-to-right (LTR) to right-to-left (RTL). Added in API level 17.

关于android - onConfigurationchanged 未通过 jellybean(4.2.1) 调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13856229/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com