android-Cocos2dxActivity闪烁
作者:互联网
当我启动Cocos2dxActivity并显示一段时间内的另一项活动(第三方sdk活动或自定义活动)时,cocos2dxActivity开始闪烁.当其他活动似乎完成时,cocos2dxActivity将恢复正常.
public class MyActivity extends Cocos2dxActivity {
public static void showSDKLogin() {
sdkMgr.showLogin();
}
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
}
static {
System.loadLibrary("game");
}
}
在sdkMgr.showLogin()函数中,它启动一个新活动以显示一些对话框.我在cocos2dx C代码中用jni称呼它.
如何解决闪烁的问题?
ps:对不起,我英语不好.我希望你们知道我的意思;)
解决方法:
关于Android上的闪烁,这是解决方案-https://github.com/cocos2d/cocos2d-x/pull/5320
您应该更新文件“ Cocos2dxGLSurfaceView.java”,然后更新“ onPause”和“ onResume”
@Override
public void onResume() {
super.onResume();
this.setRenderMode(RENDERMODE_CONTINUOUSLY);
this.queueEvent(new Runnable() {
@Override
public void run() {
Cocos2dxGLSurfaceView.this.mCocos2dxRenderer.handleOnResume();
}
});
}
@Override
public void onPause() {
this.queueEvent(new Runnable() {
@Override
public void run() {
Cocos2dxGLSurfaceView.this.mCocos2dxRenderer.handleOnPause();
}
});
this.setRenderMode(RENDERMODE_WHEN_DIRTY);
// super.onPause();
}
干杯.
标签:cocos2d-x,android-activity,c-4,android 来源: https://codeday.me/bug/20191122/2062747.html