With Exit you can cancel and completely stop the app.
You can also forcefully kill the app by passing true as first argument.
Example - Exit dialog
app.EnableBackKey( false );
app.ShowPopup( "Press the back key" );
var yesNo = app.CreateYesNoDialog( "Exit App?" );
yesNo.SetOnTouch( yesNo_OnTouch );
function yesNo_OnTouch( result )
if( result == "Yes" ) app.Exit();