12.7 Disabling Configuration Change Restarts
As previously outlined, an activity may indicate that it is not to be restarted in the event of certain configuration changes. This is achieved by adding an android:configChanges directive to the activity element within the project manifest file. The following manifest file excerpt, for example, indicates that the activity should not be restarted in the event of configuration changes relating to orientation or device-wide font size:
<activity android:name=".MainActivity"
android:configChanges="orientation|fontScale"
android:label="@string/app_name">