Load screen for android

Load screen for android


so i want to show my logo while game load. how can i do that ?


First show the logo, then let cocos draw, then start loading


what do you mean by let cocos draw ? and can you give example


This just came up in another topic a week or two ago. You can use your custom logo instead of the Cocos Creator logo…


can you send the link to how to do that would be the best


search these forums too. This is answered a few times.


well there isn’t a splash png jsb-default file


I don’t understand this.


well im building for android not web and jsb-default file which is for native build doesn’t have a splash.png file inside of it that i can change


There are several threads on this:


You should set some stuffs manually in your project default build folder. Follow these steps:

  1. Put your load screen PNG file in a folder of /res. Eg.: /proj.android-studio/app/res/drawable/mylogo.png
  2. Create a launch screen XML file to load the PNG file. Name it as launch_screen.xml and put the XML file in the same folder of PNG file.
<?xml version="1.0" encoding="utf-8"?>

<layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:opacity="opaque">
  <!-- The background colour -->
  <item android:drawable="@android:color/black"/>
  <!-- Your splash file - your png file name without extension-->
  1. Create styles.xml in proj.android-studio/app/res/values/styles.xml. Item section should refer to launch screen XML file at step 2.
<?xml version="1.0" encoding="utf-8"?>
  <style name="AppTheme" parent="@android:style/Theme.NoTitleBar.Fullscreen">
    <item name="android:windowBackground">@drawable/launch_screen</item>
  1. Find activity section in AndroidManifest.xml. Replace android:theme parameter, refer to the style name parameter in styles.xml at step 3.
            android:taskAffinity="" >
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
  1. Last step. Edit AppActivity.java. You can find it in /proj.android-studio/app/src/org/cocos2dx/javascript/AppActivity.java. Find onCreate method and call setTheme function. You should call setTheme function before super.onCreate command. Please use your app package name to get R.style property. R.style property should refer to the style name parameter as in styles.xml at step 3.
protected void onCreate(Bundle savedInstanceState) {
        setTheme([your app Package Name].R.style.AppTheme);
        // Workaround in https://stackoverflow.com/questions/16283079/re-launch-of-activity-on-home-button-but-only-the-first-time/16447508
        if (!isTaskRoot()) {
            // Android launched another instance of the root activity into an existing task
            //  so just quietly finish and go away, dropping the user back into the activity
            //  at the top of the stack (ie: the last state of this task)
            // Don't need to finish it again since it's finished in super.onCreate .

Hope it’ll help.


Hey, Thanks for the reply. haven’t tried yet had exams I will hopefully today.


I’ve tried this method.

It doesn’t show image on Android 4.4.2
It show image and switches to black again on Android 8.0.0

Do we have any workaround?


damn 1 month passed and i still havent tested it :smiley: