Question

I have confronted a weired bug on Android with cocos2d-x.

There's one scene for user logining or registering, added two EditBox allowing player input username and password. Everything is fine on IOS and Windows.

On Android, things get strange. When the the edit box pop up, if switch the IME, for example between Chinese and English, after push the done key on soft keyboard, the Scene enter onEnter function again and lost the text just input.

I checked CCEditBoxImplAndroid and Cocos2dxEditBoxDialog.java, can't find the reason. Anyone have some idea?

cocos2d-x version is 3.0 alpha.

No correct solution

OTHER TIPS

OK, finally I find the reason.

When the soft keyboard pop up, cocos2d-x put the scene into background, called AppDelegate::applicationDidEnterBackground function, and then called AppDelegate::applicationWillEnterForeground after close the soft keyboard.

Some code in applicationWillEnterForeground lead my reenter scene problem. Find it by lucky.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top