Black Screen Occurs after closing an activity with Cocos2d-x v2.2.2?

Hi, I recently upgraded my Cocos2d-x to the recent one v2.2.2

One new problem i got is when i run an activity over my main app and then close the activity, my main app goes blank (black screen).
I can only see the frame rate but I can still click the buttons (within that blank screen).
Is this a know new bug? How can I fix this?

If I switch to a different scene, the display comes back on.

I hope somebody can help me thanks.

FARHAN

anybody know how do i create a new activity (just a temp one) over the main activity and then close it without causing a blank screen for the main app? the current way i did causes a blank screen when i close the secondary activity. it works fin on the older cocos2d-x but not this new one :confused:

anybody ever encounter this problem?

Hi,

I have similar behaviour with sprites. Try to use the main thread to switch between scenes.

M.

M. Farhan A. Rahman wrote:

anybody know how do i create a new activity (just a temp one) over the main activity and then close it without causing a blank screen for the main app? the current way i did causes a blank screen when i close the secondary activity. it works fin on the older cocos2d-x but not this new one :confused:

anybody ever encounter this problem?

I just took a try to open a new activity in sample, but haven’t encounter the problem.
Can you submit a sample project to reproduce the problem? Then I can debug it myself.

If it’s a bug of our engine, we will add a issue and solve it as soon as possible. Otherwise, if it’s a problem of your code, maybe I can give you some suggestions.

Hi Bin Zhang,

Here is the sample code I am using to open a new activity.
I am opening new activity to play a video.
I just wondering, does cocos2d-x support playing a video?

In Cocos2dxActivity.java, I have this

protected static Activity me = null;

@Override
protected void onCreate(final Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
me = this; // Just added this
…the rest of default cocos2d-x codes
}
// ===========================================================
// Inner and Anonymous Classes
// ===========================================================
public static void playVideo(final String msg)
{
Intent i = new Intent();
i.setClass(me, Cocos2dxVideo.class);
me.startActivity(i);
}

And I have attached the Video java code file.
Basically, it is an extended Activity class and after I am done playing the video I just close the activity by calling
me.finish(); // me is the Video activity

Everything works fine with the older version of cocos2d-x but not the current one.
It closes the activity and goes back to the main app activity but the screen is blank.

Let me know if something is wrong with my code.

By the way, is there a way to open a new activity from/using Cocos2d-x? or a better/proper way?
I’m currently manually calling the java code from c++.

Hope you could help.
Thank you very much.

FARHAN

Bin Zhang wrote:

M. Farhan A. Rahman wrote:

anybody know how do i create a new activity (just a temp one) over the main activity and then close it without causing a blank screen for the main app? the current way i did causes a blank screen when i close the secondary activity. it works fin on the older cocos2d-x but not this new one :confused:

anybody ever encounter this problem?

I just took a try to open a new activity in sample, but haven’t encounter the problem.
Can you submit a sample project to reproduce the problem? Then I can debug it myself.

If it’s a bug of our engine, we will add a issue and solve it as soon as possible. Otherwise, if it’s a problem of your code, maybe I can give you some suggestions.

Anybody know how to run a second activity on top of the main activity and close this second activity and resume the main activity?

Thanks.

M. Farhan A. Rahman wrote:

Anybody know how to run a second activity on top of the main activity and close this second activity and resume the main activity?

Thanks.

Hi, M. Farhan A. Rahman
I just add some code to run a second activity based project “HelloCpp” in cocos2d-x-2.2.2.
You can download the attachment:HelloCpp.zip and replace the project “HelloCpp” in cocos2d-x-2.2.2.
Then take a try to run the project. It works fine on my device.

Hope it’s helpful.