Cocos2dxActivity flicker

when i start a Cocos2dxActivity and show another activity (third party sdk activity or custom activity) sometime, the cocos2dxActivity is flickering. when the another activity appear completed, the cocos2dxActivity return normally.

public class MyActivity extends Cocos2dxActivity {
public static void showSDKLogin() {
sdkMgr.showLogin();
}
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
}
static {
System.loadLibrary(“game”);
}
}

in sdkMgr.showLogin() function it start a new activity to show some dialog. i call it by jni in cocos2dx c++ code.

how to solve the flicker problem

ps: sorry about my poor english. i wish you guys know what i mean :wink:

I have the same problem!

I’m integrating Samsung In-App purchasing, and when the Samsung’s purchase dialog appears, the game screen flickers. It’s like when there are two screens which are switching at 60FPS.

The same thing happens with Google Play game services.

This happens also when there’s no dialog displayed, but another activity is started to do some work, like authenticating the user with Samsung Account.

This is a serious issue. I don’t know is it our fault or there is a bug in cocos2dx?

i think it is our bug, a lot of games using the same sdk api do not flicker. but i can’t find any suggestion with google

Attila Szilágyi wrote:

I have the same problem!
>
I’m integrating Samsung In-App purchasing, and when the Samsung’s purchase dialog appears, the game screen flickers. It’s like when there are two screens which are switching at 60FPS.
>
The same thing happens with Google Play game services.
>
This happens also when there’s no dialog displayed, but another activity is started to do some work, like authenticating the user with Samsung Account.
>
This is a serious issue. I don’t know is it our fault or there is a bug in cocos2dx?

I have the same issue and still don’t know how to fix it.
Did You fix the issue?

What version of Cocos2d-x?

No, I didn’t fix the issue.

Version 2.1.3. I didn’t try with newer versions.

Cocos2d-x 2.2.0
Here is some video http://youtu.be/IH1WEggREUg
Program loads screen1, then switches to screen2 and then the program calls

Activity.runOnUiThread(new Runnable() {
            public void run() {
                gameHelper.beginUserInitiatedSignIn();
            }
        });

where gameHelper is instance of GameHelper (Google Play Service helper class)

I delay calling beginUserInitiatedSignIn in 3 seconds and everything seems okay!

I fixed this issue. Fix: https://github.com/cocos2d/cocos2d-x/pull/5320

1 Like

seagull wrote:

I fixed this issue. Fix: https://github.com/cocos2d/cocos2d-x/pull/5320

thx i will try it

Does anyone have any idea why the call to ‘super.onPause()’ is commented out?

That is really suspicious.

Is this an issue on 3.0beta2?

Thanks a lot man… You made my day… :slight_smile:

@seagull wrote:

I fixed this issue. Fix: https://github.com/cocos2d/cocos2d-x/pull/5320

@khanna27rahul
i also experienced the same problem and did the fix as mentioned above…but what if the net is very slow and trying to connect. In my case the net is continuously trying to connect.When I press back key the account screen come and then i click on cancel.But still i cant touch any of my cocos2dx button there and the screen view is still on google.How can i solve that problem. I just want a timeout if net doesnt connect in 10 seconds.