문제

I am developing a game using Cocos2d FrameWork in Android.

I encountered a problem while testing on Motorola Xoom.

What I want to do :

  • When User pressed Volume up and Volume down Button. All the Animation should play with sound .

But What actually Happened:

  • When I pressed volume up down button on Motorola Xoom than My Game Lost Focus and all Animation Paused but sound is playing according to the volume button settings.

This is only when I test my Application in Honey Comb OS.

I am using onWindowFocusChanged method to Resume Game Play.

Anyone having encounter this type of problem ?
Please let me know if anyone have solution for this .

Thanks.

도움이 되었습니까?

해결책

i found answer myself ..

Here is the solution of this issue ..

public void onWindowFocusChanged(boolean hasFocus) 
{
    synchronized(sGLThreadManager) {
    //mHasFocus = hasFocus;
    mHasFocus = true;
    sGLThreadManager.notifyAll();
    }
    if (LOG_SURFACE) 
    {
        Log.i("Main thread", "Focus " + (mHasFocus ? "gained" : "lost"));
    }
}

just change mHasFocus = true in GLSurfaceView class of Cocos2d android ...

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