androidmotorolaxoomcocos2d-android

Cocos2d Game Lost Focus When we click Volume Up or Volume Down Button On Motorola xoom


I am developing a game using Cocos2d FrameWork in Android.

I encountered a problem while testing on Motorola Xoom.

What I want to do :

But What actually Happened:

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.


Solution

  • 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 ...