Android Question Android setting TurnOff screen after x minutes no activity does not work anymore

AHilberink

Active Member
Licensed User
Longtime User
Hi,

I changed my service for Firebase Notifications to a Receiver. Could this be a reason why my TurnOff screen setting is not working anymore? I also changed my B4A van v12.00 to v12.50.

It is strange. Not doying anything and still no TurnOff (normally after 5 minutes).

Does anyone experience the same or do I have to look for another reason (android update etc)?

Kind regards,
André
 

mangojack

Expert
Licensed User
Longtime User
Does anyone experience the same or do I have to look for another reason (android update etc)?

Are you referring to changing the Display Timeout setting ?

The following code has stopped functioning on Oppo A16 when it updated to Android 13 recently.
It still works on my Samsung A50 running 12.

I don't think it has anything to do with shifting to Receiver's.

I use this shortcut to increase screen display timeout when debugging.

B4X:
Sub SetScreenOffTimeout(timeout As Int)
   Dim context As JavaObject
   context.InitializeStatic("anywheresoftware.b4a.BA")
   context = context.GetField("applicationContext")
   Dim settings As JavaObject
   settings.InitializeStatic("android.provider.Settings.System")
   settings.RunMethod("putInt", Array As Object(context.RunMethod("getContentResolver", Null), _
     "screen_off_timeout", timeout))
End Sub
 
Upvote 0
Top