문제

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.

올바른 솔루션이 없습니다

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top