Skip to content

Instantly share code, notes, and snippets.

@UtkuGlsvn
Last active May 21, 2019 17:42
Show Gist options
  • Save UtkuGlsvn/7c06ca9243412b0cb3900d83989bcf70 to your computer and use it in GitHub Desktop.
Save UtkuGlsvn/7c06ca9243412b0cb3900d83989bcf70 to your computer and use it in GitHub Desktop.
Drawable:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/colorPrimary"/>
<item android:gravity="center">
<bitmap android:src="@drawable/my_logo"
android:gravity="center">
</bitmap>
</item>
</layer-list>
--------------------------------------------------------
java:
public class SplashActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
startActivity(new Intent(SplashActivity.this,MainActivity.class));
finish();
}
-------------------------------------------------------------------
-> Android Manifest
android:theme="@style/AppTheme.SplashTheme">
<activity android:name=".SplashActivity">
----------------------------------------------------------------------
Style xml:
<!-- SplashScreen theme. -->
<style name="AppTheme.SplashTheme">
<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