Back

SetRingerMode

Hello World

Change the current ringer mode of the device which can be “Normal”, “Vibrate” or “Silent”.

app.SetRingerMode( mode )

See Also: GetRingerMode

Example - SetRingerMode Demo

function OnStart()
{
    lay = app.CreateLayout( "linear", "VCenter,FillXY" );

    spn = app.CreateSpinner( "Normal,Vibrate,Silent" );
    spn.SetOnChange( SetRingerMode );
    lay.AddChild( spn );

    btn = app.CreateButton( "Press Me", 0.3, 0.1 );
    btn.SetOnTouch( Notify );
    lay.AddChild( btn );

    app.AddLayout( lay );
}

function SetRingerMode( mode )
{
    app.SetRingerMode( mode );
}

function Notify()
{
    var ntf = app.CreateNotification();
    ntf.SetMessage( "RingerMode Demo", "RingerMode Demo notifies:", "Helo World" );
    ntf.Notify();
}
    Copy     Copy All       Run      
string: “Normal” or “Vibrate” or “Silent”