User Tools

Site Tools


built_in:app_events

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
built_in:app_events [2014/10/13 16:19]
stevegarman
built_in:app_events [2015/03/07 10:28]
octazid add OnAlarm()
Line 20: Line 20:
  app.SetMenu( "MyMenu1,MyMenu2" );  app.SetMenu( "MyMenu1,MyMenu2" );
  app.EnableBackKey( false );  app.EnableBackKey( false );
-}+ 
 +        //Get current time in milliseconds.  
 +        var now = new Date().getTime();  
 +        //Set alarm for 3 seconds time.  
 +        app.SetAlarm( "Set", 1234, OnAlarm, now + 3000 ); }
  
 //Called when user selects a menu item. //Called when user selects a menu item.
Line 55: Line 59:
  app.ShowPopup( "OnConfig" );      app.ShowPopup( "OnConfig" );    
 } }
-</code>+ 
 +//Called when alarm is triggered.  
 +//(Even if your app is closed)  
 +function OnAlarm( id )  
 +{  
 +    app.ShowPopup( "Got Alarm: id = " + id );  
 +</code>
built_in/app_events.txt · Last modified: 2018/12/30 13:31 (external edit)