當前的activity切換到后台,切換語言,回到原來的activity,原來的activity不見,出現又一新activity。
原因:沒有在AndroidManifest.xml 中申明android:configChanges
android:configChanges
Lists configuration changes that the activity will handle itself. When a configuration change occurs at runtime, the activity is shut down and restarted by default, but declaring a configuration with this attribute will prevent the activity from being restarted. Instead, the activity remains running and its
method is called.onConfigurationChanged()
解決在AndroidManifest.xml中申明 android:configChanges="locale"