作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我试图在我的主要 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/
我是一名优秀的程序员,十分优秀!