Skip to content Skip to sidebar Skip to footer

Stop Activity Restart On Font Change

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

Solution 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.

Post a Comment for "Stop Activity Restart On Font Change"