How to prevent cocos2d-x from handling back button on Android?

I googled a lot but couldn’t find the answer so I am posting my question here. I see cocos2d-x is focused on game type of apps where OpenGL is used throughout the app and no native UI is involved. My scenario is different because I use cocos2d-x only inside one Activity. But it appears that cocos2d-x absorbs the back button press event. I want the Activity to handle it and use the default behavior to go back to previous Activity. Is there a way to do that?

Thanks

You implement keyBackClicked() on your layer. Then from there, call a Java method (through JNI) and make it handle the back button.