在manifest文件中:
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".ACDsee"
android:label="@string/app_name"
android:theme="@style/test"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
只需要修改activity中的theme就可以了,
在value文件夹中新建一个test.xml:
<style name="test" parent="android:Theme">
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@drawable/bg</item>
</style>
这样的话activity启动后就会马上替换成一张图片,
然后再程序的onCreate方法的最后让activity的背景换为黑色背景就可以了,
getWindow().setBackgroundDrawableResource(R.xml.color);