Cocos2d-x 2.2.6 texture reload issue

hi
my team developed our game using cocos2d-x 2.2.6 and using android minSdkVersion = 19, targetSdkVersion = 25.
After run the application(game) and go to background and come back to our game it happens because it couldn’t reload texture so it shows as black screen
For now my team have research to this problem. It seems to me if we upgrade our engine to cocos2d-x 3.x this could be solved.
But unfotunately app is on service, it is very hard to upgrade the engine.

help me…

:slight_smile: I recently converted cocos2d-x 2.2.6 to support gradle build - recommend to do same for you:) Regarding blacktextures you probably mean after video ads?

@energyy That’s right, I’m having trouble viewing video ads or changing to another app …
Please take a link to help convert. Will changing to gradle build solve the problem?

It will be helpful if you release your whole solution.

No it will not help that much with black squares, ussualy this balck squares appear if u running animations and app get overlayed with videos , so u need cancel all animations and start them only when app is back active.

@energyy so Is it impossible to fix a texture problem in cocos 2.2.6 when go to background and comeback to app?

Is possible with game logic, there is no solution with just one line

@energry Setting targetSdkVersion to 10 is not a problem. Problems occur from 14 or more.

@yinjimmy setting target SdkVersion to 10 is not a problem. Problems occur from 14 or more…

@energyy @yinjimmy please help me. User complaints are increasing.
but i can’t find solution still yet

Although I don’t know your whole situation, I had the similar problem and my solution was this:

If your game is portrait mode and the video ad is landscape, or vice versa, try this in android manifest file :

<activity android:name=“YOUR_COCOS2DX_ACTIVITY”

android:configChanges=“orientation|keyboardHidden|screenSize”>

add ‘keyboardHidden’ and ‘screenSize’ in the “configChanges” item

this will prevent android activity from being destroyed when the orientation changes (port. -> land. or land. -> port.), and all the texture of the activity will stay preserved.

@usually I applied the method you gave me so I solved the problem. Thank you very much.