In our android unity app, a standard splash screen appears when we start the app (or build to android device) which is done through Unity’s Edit → Project Settings → Player but we now have a feature that sometimes in the middle of the app, the user presses the home button and re-starts the app, so we would like to code this behavior, so that we can show a different splash screen if the app re-starts mid-usage.
So, we created a new scene with that extra splash screen and added it to the build with index 4
What we have already implemented is through:
PlayerPrefs.SetInt("Restarting", 1);
PlayerPrefs.Save();
#if UNITY_ANDROID && !UNITY_EDITOR
AndroidPlugin.Restart();
SceneManager.LoadScene(4);
#else
SceneManager.LoadScene("MainScene");
#endif
which should load the extra splash screen when the app is reloading mid-usage, but it does not…
What are we missing or doing wrong that the app does not load the new splash screen?
p.s. The AndroidPlugin.Restart(); clears the memory since we had a lot of crashes to do with android memry management.