Open MFHSchoonbrood opened 9 years ago
Here is the callstack when I break at the main activities onStop() function.
MyGame [Android Application]
DalvikVM[localhost:8600]
Thread [<1> main] (Suspended (breakpoint at line 126 in MyGame))
<VM does not provide monitor information>
MyGame.onStop() line: 126
Instrumentation.callActivityOnStop(Activity) line: 1212
MyGame(Activity).performStop() line: 5376
ActivityThread.performDestroyActivity(IBinder, boolean, int, boolean) line: 3442
ActivityThread.handleDestroyActivity(IBinder, boolean, int, boolean) line: 3501
ActivityThread.handleRelaunchActivity(ActivityThread$ActivityClientRecord) line: 3701
ActivityThread.access$900(ActivityThread, ActivityThread$ActivityClientRecord) line: 135
ActivityThread$H.handleMessage(Message) line: 1202
ActivityThread$H(Handler).dispatchMessage(Message) line: 102
Looper.loop() line: 136
ActivityThread.main(String[]) line: 5001
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]
Method.invoke(Object, Object...) line: 515
ZygoteInit$MethodAndArgsCaller.run() line: 785
ZygoteInit.main(String[]) line: 601
NativeStart.main(String[]) line: not available [native method]
I'm testing on a nexus 7 with a bluetooth keyboard.
If I turn the keyboard on or off while a cocos app is running, the screen turns black and I only see font texts (tested with ttf and bitmap font).
What seems to happen is that the whole app is destroyed and recreated (judging by the message flow). Here is the relevant log:
First of all, it seems weird this happens at all... Why does the whole app need to be recreated, just because I turned on/off a bluetooth keyboard?
Second: All textures seem to be unloaded, so why is my bitmap font texture not unloaded? Is this by design or an oversight?
Third: How can I fix this? Is there a way in the code to detect that the textures have been unloaded, and reload them?
Kind regards, Michaël