DroidScript wiki

(was AndroidScript) unofficial documentation by the community

User Tools

Site Tools



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

Link to this comparison view

built_in:go_to_sleep [2015/03/04 17:58] (current)
octazid created
Line 1: Line 1:
 +//​(Information and examples taken from the DroidScript documentation)//​
 +The **GoToSleep** method forces the screen to turn off and puts the device to sleep. This has the same effect as pressing the power button. ​
 +<​code>​ app.GoToSleep();</​code>​
 +After using this function rotating the phone/​tablet will have no effect on the app's orientation. To unlock the orientation call the function again using the orientation "​Default"​.
 +<code javascript>​
 +function OnStart()
 +  app.GoToSleep();​
built_in/go_to_sleep.txt ยท Last modified: 2015/03/04 17:58 by octazid