赞
踩
第一步:创建LunchActivity
- public class LunchActivity extends AppCompatActivity {
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate( savedInstanceState );
- new Thread( new Runnable( ) {
- @Override
- public void run() {
- //耗时任务,比如加载网络数据
- runOnUiThread(new Runnable() {
- @Override
- public void run() {
- startActivity(Intent(this, MainActivity::class.java))
- }
- });
- }
- } ).start();
- }
-
- }
第二步:AndroidManifast文件设置LunchActivity为第一个页面,并添加主题
- <activity
- android:name=".LunchActivity"
- android:theme="@style/LunchTheme">
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- <category android:name="android.intent.category.LAUNCHER"/>
- </intent-filter>
- </activity>
主题设置
- <style name="LunchTheme" parent="Theme.AppCompat">
- <item name="android:windowNoTitle">true</item>
- <item name="android:windowFullscreen">true</item>
- <item name="android:statusBarColor">@android:color/transparent</item>
- <item name="android:windowBackground">@drawable/background_gradient</item>
- </style>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。