前言
热启动:利用后台已经拥有的进程,从而避免了Application的加载。直接去加载Activity。
- 加入动画
- 使用占位图
- 使用图片
- 使用windowDisablePreview属性
windowDisablePreview属性<style name=[color=rgb(0, 153, 0) !important]"SplashTheme" parent=[color=rgb(0, 153, 0) !important]"AppTheme"> <item name=[color=rgb(0, 153, 0) !important]"android:windowDisablePreview">[color=rgb(0, 153, 0) !important]true</item> </style>
- 1
- 2
- 3
[color=rgb(155, 133, 157) !important]@Override [color=rgb(0, 0, 136) !important]protected [color=rgb(0, 0, 136) !important]void [color=rgb(0, 153, 0) !important]onCreate(@Nullable Bundle savedInstanceState) { setTheme(R.style.AppTheme); getWindow().setBackgroundDrawableResource(R.drawable.main_splash_bg); [color=rgb(0, 0, 136) !important]super.onCreate(savedInstanceState); }
- 1
- 2
- 3
- 4
- 5
- 6
使用占位图 <style name=[color=rgb(0, 153, 0) !important]"SplashTheme" parent=[color=rgb(0, 153, 0) !important]"AppTheme"> <item name=[color=rgb(0, 153, 0) !important]"android:windowBackground">@drawable/shape_launch</item> <item name=[color=rgb(0, 153, 0) !important]"android:windowFullscreen">[color=rgb(0, 153, 0) !important]true</item> </style>
- 1
- 2
- 3
- 4
[color=rgb(0, 102, 102) !important]<layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:opacity="opaque"> [color=rgb(0, 102, 102) !important]<item android:drawable="@android:color/white"/> [color=rgb(0, 102, 102) !important]<item> [color=rgb(0, 102, 102) !important]<bitmap android:src="@mipmap/main_splash_bg" android:gravity="fill" /> [color=rgb(0, 102, 102) !important]</item>[color=rgb(0, 102, 102) !important]</layer-list>
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11