{"action":"created","issue":{"url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/10280","labels_url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/10280/labels{/name}","comments_url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/10280/comments","events_url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/10280/events","html_url":"https://github.com/cocos2d/cocos2d-x/issues/10280","id":55882588,"number":10280,"title":"某些Activity切换情况，会导致Cocos2dxRenderer onDrawFrame不再调用","user":{"login":"firegames","id":2697724,"avatar_url":"https://avatars.githubusercontent.com/u/2697724?v=3","gravatar_id":"","url":"https://api.github.com/users/firegames","html_url":"https://github.com/firegames","followers_url":"https://api.github.com/users/firegames/followers","following_url":"https://api.github.com/users/firegames/following{/other_user}","gists_url":"https://api.github.com/users/firegames/gists{/gist_id}","starred_url":"https://api.github.com/users/firegames/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/firegames/subscriptions","organizations_url":"https://api.github.com/users/firegames/orgs","repos_url":"https://api.github.com/users/firegames/repos","events_url":"https://api.github.com/users/firegames/events{/privacy}","received_events_url":"https://api.github.com/users/firegames/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"Dhilan007","id":5234286,"avatar_url":"https://avatars.githubusercontent.com/u/5234286?v=3","gravatar_id":"","url":"https://api.github.com/users/Dhilan007","html_url":"https://github.com/Dhilan007","followers_url":"https://api.github.com/users/Dhilan007/followers","following_url":"https://api.github.com/users/Dhilan007/following{/other_user}","gists_url":"https://api.github.com/users/Dhilan007/gists{/gist_id}","starred_url":"https://api.github.com/users/Dhilan007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dhilan007/subscriptions","organizations_url":"https://api.github.com/users/Dhilan007/orgs","repos_url":"https://api.github.com/users/Dhilan007/repos","events_url":"https://api.github.com/users/Dhilan007/events{/privacy}","received_events_url":"https://api.github.com/users/Dhilan007/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-01-29T10:35:13Z","updated_at":"2015-01-30T03:47:27Z","closed_at":null,"body":"某些Activity切换的情况（我这边是使用小米2，在接入应用宝SDK，使用QQ登录，很高概率发生），会导致Cocos2dxRenderer实效，onDrawFrame不再被调用，mainloop停止。\r\n\r\ncocos2dx原代码如下：\r\n\r\n     @Override\r\n\tpublic void onResume() {\r\n\t\tsuper.onResume();\r\n\t\tthis.queueEvent(new Runnable() {\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\t\t\t\tCocos2dxGLSurfaceView.this.mCocos2dxRenderer.handleOnResume();\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void onPause() {\r\n\t\tthis.queueEvent(new Runnable() {\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\t\t\t\tCocos2dxGLSurfaceView.this.mCocos2dxRenderer.handleOnPause();\r\n\t\t\t}\r\n\t\t});\r\n\t\t//super.onPause();\r\n\t}\r\n//super.onPause();是被注释的。\r\n\r\n我修改为：\r\n\r\n      @Override\r\n      public void onResume() {\r\n\t\tsuper.onResume();\r\n\t\tCocos2dxGLSurfaceView.this.mCocos2dxRenderer.handleOnResume();\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void onPause() {\r\n\t\tCocos2dxGLSurfaceView.this.mCocos2dxRenderer.handleOnPause();\r\n\t\tsuper.onPause();\r\n\t}\r\n回复surfaceview的正常super.onPause， Cocos2dxRenderer可以正常工作。\r\n\r\n但是，对cocos2dx的事件处理造成的影响就未知了，请问下有没有更完善的解决方案？或者如何可以更好的处理surfaceview的onPause?  以及我这样修改造成的cocos2dx的异常可能会有哪些？\r\n"},"comment":{"url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/comments/72149914","html_url":"https://github.com/cocos2d/cocos2d-x/issues/10280#issuecomment-72149914","issue_url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/10280","id":72149914,"user":{"login":"minggo","id":488203,"avatar_url":"https://avatars.githubusercontent.com/u/488203?v=3","gravatar_id":"","url":"https://api.github.com/users/minggo","html_url":"https://github.com/minggo","followers_url":"https://api.github.com/users/minggo/followers","following_url":"https://api.github.com/users/minggo/following{/other_user}","gists_url":"https://api.github.com/users/minggo/gists{/gist_id}","starred_url":"https://api.github.com/users/minggo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minggo/subscriptions","organizations_url":"https://api.github.com/users/minggo/orgs","repos_url":"https://api.github.com/users/minggo/repos","events_url":"https://api.github.com/users/minggo/events{/privacy}","received_events_url":"https://api.github.com/users/minggo/received_events","type":"User","site_admin":false},"created_at":"2015-01-30T03:47:27Z","updated_at":"2015-01-30T03:47:27Z","body":"Yep, it includes all pictures, and it will do every time.\r\nEngine will reload it automatically."}}