Created
December 17, 2019 04:02
-
-
Save irmanfrdev/74d44c95fc090d4c22ba48f6142927c2 to your computer and use it in GitHub Desktop.
Android Splash Screen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
<activity | |
android:name=".SplashActivity" | |
android:theme="@style/SplashTheme"> | |
<intent-filter> | |
<action android:name="android.intent.action.MAIN" /> | |
<category android:name="android.intent.category.LAUNCHER" /> | |
</intent-filter> | |
</activity> | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
res/drawable | |
<?xml version="1.0" encoding="utf-8"?> | |
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item android:drawable="@android:color/white"/> | |
<item> | |
<bitmap | |
android:src="@drawable/logo" | |
android:gravity="center" /> | |
</item> | |
</layer-list> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SplashActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
startActivity(new Intent(SplashActivity.this, MainActivity.class)); | |
finish(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
res/values/styles.xml | |
... | |
<!--Splash screen theme--> | |
<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar"> | |
<item name="android:windowBackground">@drawable/splash_background</item> | |
</style> | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment