This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
app_methods:enablebackkey [2015/02/22 09:34] octazid created |
app_methods:enablebackkey [2015/03/04 23:56] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | =====app.EnableBackKey===== | + | =====EnableBackKey===== |
- | (Sample | + | |
+ | //(Information and examples | ||
+ | |||
+ | ====Description==== | ||
+ | |||
+ | The **EnableBackKey** enables or disables the standard behaviour of the back key in your app. If you disable it, then your app will not close when the back key is pressed. | ||
+ | |||
+ | When the back button is pressed, the **OnBack** callback function is called (if it exists). This allows you to change the behaviour of this button. | ||
+ | |||
+ | < | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ====Example==== | ||
<code javascript> | <code javascript> | ||
+ | |||
function OnStart() | function OnStart() | ||
{ | { | ||
- | app.EnableBackKey( false ); | + | |
} | } | ||
- | function OnBack() | + | function OnBack() |
{ | { | ||
- | var yesNo = app.CreateYesNoDialog( "Exit App?" ); | + | |
- | yesNo.SetOnTouch( yesNo_OnTouch ); | + | yesNo.SetOnTouch( yesNo_OnTouch ); |
} | } | ||
function yesNo_OnTouch( result ) | function yesNo_OnTouch( result ) | ||
{ | { | ||
- | if( result==" | + | |
} | } | ||
+ | |||
</ | </ |