When activity is recreated (due to configuration is changed),
preference screen is created before SettingsActivity sets view layout
and results in NPE. As a workaround, save the states inside
MainSwitchBarPreference to fix the problem.
Bug: 332201912
Flag: EXEMPT library
Test: manual
Change-Id: I052cd0a521dac203a5f58963c550911e7a741e6f