机器人:机器人:在三星设备字体样式变化configChanges值机器人、样式、字体、设备

2023-09-06 04:52:05 作者:ガ綠魄

要处理的字体样式更改的自己。什么将是价值? 使用下面的值now.But系统杀死的应用程序,并重新启动。      android:configChanges="orientation|keyboardHidden|fontScale|locale|layoutDirection|screenSize|screenLayout|mnc|mcc|uiMode|navigation|smallestScreenSize"

Want to handle the Font Style Change myself.what will be the value? Using the below values now.But the system kills the app and restarts. android:configChanges="orientation|keyboardHidden|fontScale|locale|layoutDirection|screenSize|screenLayout|mnc|mcc|uiMode|navigation|smallestScreenSize"

感谢 尼茨

Thanks Nitz

推荐答案

我不认为这是可能的,很遗憾。这似乎是使用的配置更改的不同的机制而不是

I don't think this is possible, unfortunately. This seems to be using a different mechanism instead of configuration changes.

设置一个服务侦听 android.intent.action.CONFIGURATION_CHANGED 没有收到意向时,在对话框中选择新的字体(但它的时候的字体大小的改变,例如)。 如果它被处理为配置更改,那么的活动的将被重新启动,而不是应用程序本身,因为它是这里的情况。 即使是这样,在安卓configChanges 属性不接受任意值,但只有那些在的文档。所以就没有办法处理的自定义配置更改。 Setting up a service to listen for android.intent.action.CONFIGURATION_CHANGED does not receive an Intent when a new font is selected in the dialog (but it does when the font size is changed, for example). If it was handled as a configuration change, then the activities would be restarted, but not the app itself, as it's the case here. Even if it were, the android:configChanges attribute does not accept arbitrary values, but only those listed in the documentation. So there would be no way to handle custom configuration changes.

如果我猜的话,我会说,三星的定制UI强行重新启动所有的应用程序时的字体更改。

If I had to guess, I'd say that Samsung's custom UI forcibly restarts all applications whenever the font is changed.