Android :android:configChanges value for Font Style change in Samsung Device

倖福魔咒の 提交于 2019-11-28 01:49:59

问题


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


回答1:


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

  1. 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).
  2. 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.
  3. 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.

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



来源:https://stackoverflow.com/questions/21554419/android-androidconfigchanges-value-for-font-style-change-in-samsung-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!