我的问题有以下2个情况会重现:
1、每次点击通知返回到游戏时,会出现部分图片变黑。
2、再后退等待一定时间,等待时使用了其他APP,回到游戏也会出现部分图片变黑。
如果出现部分图标变黑,那么,调用cocos的退出游戏方法(Director::end())时,会出现游戏重新启动一次。
以下是简单的android(release)log:
退出到后台:
01-06 07:57:31.516 5636-5636/com.xxx.xxx123 D/PhoneWindow﹕ couldn’t save which view has focus because the focused view org.cocos2dx.lib.Cocos2dxGLSurfaceView@40575ea0 has no id.
01-06 07:57:31.606 5636-5647/com.xxx.xxx123 I/GLThread﹕ noticed surfaceView surface lost tid=12
01-06 07:57:31.606 5636-5647/com.xxx.xxx123 W/EglHelper﹕ destroySurface() tid=12
01-06 07:57:31.743 5636-5636/com.xxx.xxx123 W/IInputConnectionWrapper﹕ showStatusIcon on inactive InputConnection
从后台回到游戏,并正常:
01-06 07:57:38.050 5636-5636/com.xxx.xxx123 D/dalvikvm﹕ GC_EXPLICIT freed 680K, 50% free 3918K/7751K, external 1657K/2108K, paused 69ms
01-06 07:57:42.733 5636-5636/com.xxx.xxx123 I/GLThread﹕ onResume tid=12
01-06 07:57:42.760 5636-5647/com.xxx.xxx123 I/GLThread﹕ noticed surfaceView surface acquired tid=12
01-06 07:57:42.760 5636-5647/com.xxx.xxx123 W/GLThread﹕ egl createSurface
01-06 07:57:42.760 5636-5647/com.xxx.xxx123 W/EglHelper﹕ createSurface() tid=12
01-06 07:57:42.763 5636-5636/com.xxx.xxx123 I/Main thread﹕ onWindowResize waiting for render complete from tid=12
01-06 07:57:42.786 5636-5666/com.xxx.xxx123 D/MobclickAgent﹕ App resume from background
01-06 07:57:42.800 5636-5647/com.xxx.xxx123 W/GLThread﹕ onSurfaceChanged(800, 480)
01-06 07:57:42.806 5636-5647/com.xxx.xxx123 I/GLThread﹕ noticing that we want render notification tid=12
01-06 07:57:42.810 5636-5636/com.xxx.xxx123 I/Main thread﹕ onWindowResize waiting for render complete from tid=12
01-06 07:57:42.810 5636-5647/com.xxx.xxx123 W/GLThread﹕ onSurfaceChanged(800, 480)
01-06 07:57:42.863 5636-5647/com.xxx.xxx123 I/GLThread﹕ sending render notification tid=12
从后台回到游戏,并有部分图片变黑:
01-06 08:00:21.676 5636-5636/com.xxx.xxx123 D/dalvikvm﹕ GC_EXPLICIT freed 940K, 52% free 3754K/7751K, external 1727K/2108K, paused 59ms
01-06 08:00:47.726 5636-5636/com.xxx.xxx123 D/dalvikvm﹕ Trying to load lib /data/data/com.xxx.xxx123/lib/libcocos2dlua.so 0x40513a58
01-06 08:00:47.726 5636-5636/com.xxx.xxx123 D/dalvikvm﹕ Shared lib ‘/data/data/com.xxx.xxx123/lib/libcocos2dlua.so’ already loaded in same CL 0x40513a58
01-06 08:00:47.726 5636-5636/com.xxx.xxx123 D/main﹕ cocos_android_app_init
01-06 08:00:47.726 5636-5636/com.xxx.xxx123 D/Cocos2dxActivity﹕ model=GT-I9000
01-06 08:00:47.726 5636-5636/com.xxx.xxx123 D/Cocos2dxActivity﹕ product=GT-I9000
01-06 08:00:47.726 5636-5636/com.xxx.xxx123 D/Cocos2dxActivity﹕ isEmulator=false
01-06 08:00:47.756 5636-5829/com.xxx.xxx123 I/GLThread﹕ noticed surfaceView surface lost tid=30
01-06 08:00:47.900 5636-5636/com.xxx.xxx123 I/GLThread﹕ onResume tid=30
01-06 08:00:48.026 5636-5829/com.xxx.xxx123 I/GLThread﹕ noticed surfaceView surface acquired tid=30
01-06 08:00:48.026 5636-5829/com.xxx.xxx123 W/EglHelper﹕ start() tid=30
01-06 08:00:48.100 5636-5829/com.xxx.xxx123 W/EglHelper﹕ createContext com.google.android.gles_jni.EGLContextImpl@4057e0c0 tid=30
01-06 08:00:48.100 5636-5829/com.xxx.xxx123 I/GLThread﹕ noticing that we want render notification tid=30
01-06 08:00:48.100 5636-5829/com.xxx.xxx123 W/GLThread﹕ egl createSurface
01-06 08:00:48.100 5636-5829/com.xxx.xxx123 W/EglHelper﹕ createSurface() tid=30
01-06 08:00:48.136 5636-5666/com.xxx.xxx123 D/MobclickAgent﹕ App resume from background
01-06 08:00:48.163 5636-5829/com.xxx.xxx123 W/GLThread﹕ onSurfaceCreated
01-06 08:00:49.740 5636-5638/com.xxx.xxx123 D/dalvikvm﹕ GC_CONCURRENT freed 321K, 45% free 4317K/7751K, external 1628K/2108K, paused 30ms+21ms
01-06 08:00:51.303 5636-5829/com.xxx.xxx123 W/GLThread﹕ onSurfaceChanged(800, 480)
01-06 08:00:51.316 5636-5829/com.xxx.xxx123 I/GLThread﹕ sending render notification tid=30
01-06 08:00:51.363 5636-5829/com.xxx.xxx123 D/JniHelper﹕ JniHelper::getJavaVM(), pthread_self() = 7250992
01-06 08:00:51.366 5636-5829/com.xxx.xxx123 W/dalvikvm﹕ JNI WARNING: DeleteLocalRef(0x4062e2c0) failed to find entry (valid=1)
01-06 08:00:51.366 5636-5829/com.xxx.xxx123 D/JniHelper﹕ JniHelper::getJavaVM(), pthread_self() = 7250992
01-06 08:00:52.060 5636-5829/com.xxx.xxx123 D/JniHelper﹕ JniHelper::getJavaVM(), pt
read_self() = 7250992
