Stop activity restart on font change

那年仲夏 提交于 2019-12-24 11:00:35

问题


Whenever I change font activity starts from onCreate(). How can I stop this?


回答1:


The reason for this is that changing the font scale fires a configuration change. You can see a list of that things that fire these configuration changes here.

To avoid it, you could add the attribute android:configChanges="fontScale" - but you would then need to handle that configuration change yourself by overriding onConfigurationChanged().

I advise that you read about Handling Runtime Changes before you proceed.



来源:https://stackoverflow.com/questions/8254187/stop-activity-restart-on-font-change

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