I just need to make the top bar disappear when the app starts with an image I put.
I just need to make the top bar disappear when the app starts with an image I put.
I think the best way to create the splash would be:
1: Create a splash.xml resource in the drawable folder
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/colorPrimary"/>
<item>
<bitmap
android:gravity="center"
android:src="@drawable/inicioimg"/>
</item>
</layer-list>
2. Create an activity (SplashActivity) without a layout in which you define where you want to go after loading your splas.
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent i = new Intent(getApplicationContext(), MainActivity.class);
startActivity(i);
finish();
}
}
<activity
android:name=".SplashActivity"
android:theme="@style/splashScreen">
</activity>
you can write about the Application class to tell you how long it will take for the splash
SystemClock.sleep (2000);