mirror of https://github.com/axmolengine/axmol.git
Fix #13591
This commit is contained in:
parent
30d6c82da6
commit
30d52d1394
|
@ -108,6 +108,7 @@ public abstract class Cocos2dxActivity extends Activity implements Cocos2dxHelpe
|
|||
private Cocos2dxVideoHelper mVideoHelper = null;
|
||||
private Cocos2dxWebViewHelper mWebViewHelper = null;
|
||||
private Cocos2dxEditBoxHelper mEditBoxHelper = null;
|
||||
private boolean hasFocus = false;
|
||||
|
||||
public Cocos2dxGLSurfaceView getGLSurfaceView(){
|
||||
return mGLSurfaceView;
|
||||
|
@ -338,21 +339,30 @@ public abstract class Cocos2dxActivity extends Activity implements Cocos2dxHelpe
|
|||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
Log.d(TAG, "onResume()");
|
||||
super.onResume();
|
||||
resumeIfHasFocus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWindowFocusChanged(boolean hasFocus) {
|
||||
Log.d(TAG, "onWindowFocusChanged() hasFocus=" + hasFocus);
|
||||
super.onWindowFocusChanged(hasFocus);
|
||||
|
||||
if (hasFocus) {
|
||||
Cocos2dxHelper.onResume();
|
||||
mGLSurfaceView.onResume();
|
||||
this.hasFocus = hasFocus;
|
||||
resumeIfHasFocus();
|
||||
}
|
||||
|
||||
private void resumeIfHasFocus() {
|
||||
if(hasFocus) {
|
||||
Cocos2dxHelper.onResume();
|
||||
mGLSurfaceView.onResume();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
Log.d(TAG, "onPause()");
|
||||
super.onPause();
|
||||
Cocos2dxHelper.onPause();
|
||||
mGLSurfaceView.onPause();
|
||||
|
|
Loading…
Reference in New Issue