x


Stop Mobile screens turning off

How do I stop the screen turning off on an android. I can stop the screen going dim but not to stop turning it off. My game uses the accelerometer.

Thanks

more ▼

asked Feb 04 '11 at 11:41 AM

Richard 3 gravatar image

Richard 3
424 45 50 61

(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first

this script does both

iPhoneSettings.screenCanDarken = false;

more ▼

answered Feb 04 '11 at 01:37 PM

Richard 3 gravatar image

Richard 3
424 45 50 61

(comments are locked)
10|3000 characters needed characters left

You should use:

Screen.sleepTimeout = SleepTimeout.NeverSleep;
more ▼

answered May 02 '12 at 07:36 PM

Macarse gravatar image

Macarse
52 2 5 7

I don't have enough user points/karma/whatever to upvote, yet, but this is the real right answer. .NeverSleep didn't used to exist, but it does now, and you should use it.

Feb 20 at 03:29 PM Arrow
(comments are locked)
10|3000 characters needed characters left

The iPhoneSettings.screenCanDarken is deprecated - it's now

Screen.sleepTimeout = 0f;

0 is never darken, other values in seconds - docs here

more ▼

answered Jan 27 '12 at 12:30 PM

franklynw gravatar image

franklynw
81 2 4 6

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2462
x483
x32

asked: Feb 04 '11 at 11:41 AM

Seen: 3506 times

Last Updated: Feb 20 at 03:29 PM