1

I facing a problem while launching the app. A white background is displayed for a few seconds at first start up, then at second start up sometime it doesn't appears.

I used this in my AppTheme

<item name="android:windowNoTitle">true</item>
    <item name="android:windowContentOverlay">@null</item>
    <item name="android:windowBackground">@drawable/my_app_background</item>

I am successful but it shows the my_app_background image inside the app also instead of white background

My current AppTheme

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">

    </style>

Splash Screen

public class SplashScreen extends AppCompatActivity{

    // Splash screen timer
    public static int SCREEN_TIMEOUT=3000;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splash_screen);

        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {

                Intent intent = new Intent(SplashScreen.this, MainActivity.class);
                startActivity(intent);
                finish();

                Toast.makeText(SplashScreen.this,"Message",Toast.LENGTH_SHORT).show();
            }
        }, SCREEN_TIMEOUT);

    }
}
pnuts
  • 58,317
  • 11
  • 87
  • 139
karthik kolanji
  • 2,044
  • 5
  • 20
  • 56

2 Answers2

0

put this in your manifest file:

android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
Akber
  • 521
  • 4
  • 10
0
  <item name="android:windowDisablePreview">true</item>

** put this line in your style it prevents opening white screen before splash