Hiding the manipulation of the theme, especially when starting the application, is difficult. Unfortunately, there is no way to remove this initial transition sequentially, because it is not known how fast / slow its device works. Android will always show this empty background in the default theme before inflating the layout for the main action.
But there is a trick to hide it. A screensaver that appears when the user opens the application and disappears after loading the initial activity. Thus, the splash screen hides the transition to the topic without annoying the user. Pop-up screens get some well-deserved hatred, but this situation justifies their use. Again, I do not know the specifics of your application, but you need to weigh the pros and cons of having a splash screen and a smooth transition, without a splash in the screen and a sudden transition.
There are many ways to implement a screensaver. In your case, I would try to create a launch activity with a neutral theme and apply smooth animation to transition between the splash screen and your main activity as follows:
startActivity( new Intent( LauncherActivity.this, MainActivity.class ) ); overridePendingTransition( R.anim.fade_in, R.anim.fade_out );
And animations:
<?xml version="1.0" encoding="UTF-8"?> <alpha xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_interpolator" android:fromAlpha="1.0" android:toAlpha="0.0" android:duration="300" /> <?xml version="1.0" encoding="utf-8"?> <alpha xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_interpolator" android:fromAlpha="0.0" android:toAlpha="1.0" android:duration="300" />
source share