DroidScript / Docs

DroidScript Documentation
Apache License 2.0
80 stars 29 forks source link

Exit Sample #160

Open Al4He6 opened 2 months ago

Al4He6 commented 2 months ago

Example for Exit needs line yesNo.Show()

Al4He6 commented 1 month ago

https://github.com/DroidScript/Docs/blob/63145db940b0ace9ef88855f7e3a4ec9c6c4576c/files/markup/en/app/Exit.js

This seems better

function OnStart() { app.EnableBackKey( false ); app.ShowPopup( "Press the back key" ); }

function OnBack() { var yesNo = app.CreateYesNoDialog( "Exit App?" ); yesNo.Show(); yesNo.SetOnTouch( yesNo_OnTouch ); }

function yesNo_OnTouch( result ) { if( result == "Yes" ) app.Exit(); }