參考:http://www.reibang.com/p/21d269c8ef09
創(chuàng)建文件
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--這里為繼承 CCC 默認(rèn)說采用的主題 Theme.NoTitleBar.Fullscreen -->
<style name="SplashStyle"
parent="@android:style/Theme.NoTitleBar.Fullscreen" >
<!--自定義主題背景圖片-->
<item name="android:windowBackground">@drawable/splash</item>
<!--令主題無標(biāo)題-->
<item name="android:windowNoTitle" >true</item >
</style >
</resources>
修改文件
//第一步铜跑,修改之前的初始activity為LaunchActivity
<activity
android:name="org.cocos2dx.javascript.LaunchActivity"
...
android:theme="@style/SplashStyle"
...
>
//第二步,添加一個(gè)activity標(biāo)簽來注冊之前的初始activity
<activity android:name="org.cocos2dx.javascript.AppActivity"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
添加
public class LaunchActivity extends FragmentActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// getWindow().setFlags(
// WindowManager.LayoutParams.FLAG_FULLSCREEN,
// WindowManager.LayoutParams.FLAG_FULLSCREEN);
/*采用handler創(chuàng)建子線程實(shí)現(xiàn)頁面跳轉(zhuǎn)*/
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
Intent intent =new Intent(LaunchActivity.this,AppActivity.class);
startActivity(intent);
LaunchActivity.this.finish();
}
},1000);
}
}