maybe it´s a dumb question, but I don´t get further.
How to quit my Application properly?
System.exit() creates an error. I also didn´t found any function to terminate the Application, except by returning "false" within the onKey(evt).
This gave me the next challange:
In my Application, I´d like to have a confirmation dialog, when the User press the Back-Button (Ui.KEY_ESC).
Now, I have to push a View with a delegate, which returns Yes/No, in an unlimited amount of time.
The onKey(evt)-Function expects the return value true/false to quit the App. So there is, imho, no different way then waiting for the result:
function onKey(evt)
{
if(key == Ui.KEY_ESC)
{
var quitString = Ui.loadResource(Rez.Strings.quit);
var cd = new Ui.Confirmation( quitString );
Ui.pushView( cd, new QuitDelegate(), Ui.SLIDE_IMMEDIATE );
while(quit == null)
{
}
QuitApp();
return quit;
}
}
class QuitDelegate extends Ui.ConfirmationDelegate
{
function initialize()
{
quit = null;
}
function onResponse(value)
{
if( value == 1 )
{
quit = true;
}
else
{
quit = false;
}
}
}
But this gives me an Error:
Watchdog Tripped Error - Code Executed Too Long
How can I simply leave my application after an confirmation Dialog?
Until now, I found everything in the API Documentation, the SDK samples or in this forum. But that freaks me out :confused: