Projects > cpp > Issues > Refactor #1613

We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.

Create Issue on Github

Not reload resources when coming from background on Android

Refactor #1613 [Closed]
zhangxm 2012-12-13 08:00 . Updated over 10 years ago

There is a approach to keep OpenGL context when coming to background. Some developers and me has tested this approach. It seems work great. Of course we should do more test before merging the codes.

zhangxm 2013-01-16 06:40
  • Target version changed from cocos2d-2.1beta3-x-2.1.1 to 34

The method is:
1. Not invoke super.onPause() in Cocos2dxGLSurfaceView::onPause()
2. Not reload resources after coming to foreground

After more testing, it seems this method can not work on some android devices. And i don’t know what these devices are.

zhangxm 2013-01-30 06:14
  • Target version changed from 34 to cocos2d-2.1rc0-x-2.1.2

FishingJoy has used this method to avoid reloading resources. It is installed about 0.17 billion times, and haven’t received bug report caused by this method so far(2013.1.30).

So i think this method is suitable for most devices.

zhangxm 2013-03-18 02:49
  • Priority changed from Normal to High
  • Target version changed from cocos2d-2.1rc0-x-2.1.2 to cocos2d-2.1rc0-x-2.1.3
billy1380 2013-03-25 12:54

I have applied this change locally and it seems to work if the activity is overlapped with any other (on all my phones and tablets).

I causes the game to return to a black screen (no textures loaded) if you lock the phone while the game is running… For some reason this does not happen on the Transformer TF101 but happens on all other devices.

In short it will work for everything except the if you press the power button while the game is running, then power it back :(

zhangxm 2013-04-17 10:04
  • Status changed from New to Closed
  • % Done changed from 0 to 100

Applied in changeset commit:b26d64715f818c036df2f4cb5dcdf7cd0b320a20.

agenindonesia 2014-11-25 20:33

Pokerstar88.com Agen Texas Poker Dan Domino Online Indonesia Terpercaya
OK, I’ve updated the announcement and added a link to zipball on google code. Thank you for reminding me.
Agen Indonesia | Agen Bola | Poker Indonesia

ionliga 2014-11-28 14:38

The optimization introduces a bug where the priority and Touch Mode will not get changed if the list is locked.
The most straight forward fix is to merge the pHandlersToAdd and pHandlersToRemove into a queue and process through all of them in the order they are received

Pokerstar88.com Agen Texas Poker dan Domino Online Indonesia Terpercaya | Agen Bola | Taruhan Bola | Agen Bola | Olb365.com Agen Judi Bola Online, Agen Judi Casino Online Indonesia Terpercaya

Atom PDF

Status:Closed
Start date:2012-12-13
Priority:High
Due date:
Assignee:zhangxm
% Done:

100%

Category:android
Target version:cocos2d-2.1rc0-x-2.1.3