Android Question PhoneWakeState KeepAlive(True): screen goes blank for a second

Keke

New Member
Hello Everyone,

It is a simple counter app (my first one).

I use KeepAlive(True) of PhoneWakeState in Activity_Pause and ReleaseKeepAlive in Activity_Resume.

When I run my app, screen goes dimmer in about 20 sec, then goes black for 1 sec then comes back automatically - to repeat all this 30 secs later. (My android is set to 30 sec screen timeout.)

So it is like "sort of" working, but not entirely.

What am I doing wrong?

It is Android 12.
 

teddybear

Active Member
Licensed User
Hello Everyone,

It is a simple counter app (my first one).

I use KeepAlive(True) of PhoneWakeState in Activity_Pause and ReleaseKeepAlive in Activity_Resume.

When I run my app, screen goes dimmer in about 20 sec, then goes black for 1 sec then comes back automatically - to repeat all this 30 secs later. (My android is set to 30 sec screen timeout.)

So it is like "sort of" working, but not entirely.

What am I doing wrong?

It is Android 12.
Do you add the SetActivityAttribute(Main, android:keepScreenOn, "true") to manifest?
 
Upvote 0
Top