How to end activity from engine code?

Hello. What is the best way to end simple application? I need to trigger the same action like the one that is called when clicking back button. I just need it in the engine code not the android activity part. I found that SimpleApplication object has stop() and destroy() methods but the stop() method freezes the app and destroy() throws nullPointerException.

Do the same the esc button does. Does it throws exceptions for you? Then post it here so we can check it. If your app freezes, make sure you have destroyed all your threads.

But I can’t see the compiled code from engine jars under onBackButtonPressed() action.

http://code.google.com/p/jmonkeyengine/source/checkout