gpt4 book ai didi

android - Activity B 在 Activity A 之前开始

转载 作者:行者123 更新时间:2023-11-29 17:56:19 25 4
gpt4 key购买 nike

我试图在我的主要 Activity 开始之前显示一个小图像。这是我当前在 android list 中的编码

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >

<activity
android:name=".Splash"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="com.example.test.MAINACTIVITY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>

无论我做什么,启动画面都不会启动。它们分开开始,但从不一起开始,(我还没有在我的初始图像中放置计时器,因为我想检查它是否有效以及它是否无效)

最佳答案

删除

<intent-filter>
<action android:name="com.example.test.MAINACTIVITY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>

在所需时间后在启动画面中使用以下代码

Intent intent=new Intent(this,MAINACTIVITY.class);
startActivity(intent);
finish(); //To close splashscreen when MAINACTIVITY loads

上面的代码从启动画面开始,一段时间后开始你的主要 Activity

关于android - Activity B 在 Activity A 之前开始,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19097389/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com