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;
protected void onCreate(final Bundle 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();
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.
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
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.