Activity:
public class SplashActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); startActivity(new Intent(this, MainActivity.class)); finish(); } }设置APP启动的第一个Activity为SplashActivity
android:name=".ui.activity.SplashActivity" android:theme="@style/SplashTheme"style
目的是为了消除点开应用是的白屏
解决
1: 设置windowBackground为logo或者其他图片
<style name="SplashTheme" parent="AppTheme"> <item name="android:windowBackground">@drawable/bg_home</item> </style>2:设置背景为透明色
<style name="SplashTheme" parent="android:Theme.Translucent.NoTitleBar.Fullscreen"> </style>
总结:其实就是欺骗了眼睛,看起来秒开。
注:个人笔记