Back

EnableBackKey

Allows to en- or disable the devices back key.

  app.EnableBackKey( enable )

When it was disabled function OnBack() was called as callback when the back button was pressed - otherwise the app exits.

Example - Example



function OnStart()
{
    app.EnableBackKey( false );
}

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

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

Example - Menu Images



function OnStart()
{
    menus = "Files:Files.png,Settings:Settings.png";
    app.EnableBackKey( menus, "/Sys/Img" );
}

function OnMenu( item )
{
    app.ShowPopup( item, "Short" );
}
    Copy     Copy All       Run      

boolean