using this
with this in the "what ever activity" activity resume and pause
and the release
works great on Android 5 but on Android 7 it does not wake the phone.
Any pointers as to why appreciated
B4X:
Sub GetScreen
If Not(IsScreenOn) Then
startactivity("what ever activity name")
End If
End Sub
B4X:
Sub IsScreenOn As Boolean
Dim R As Reflector
R.Target = R.GetContext
R.Target = R.RunMethod2("getSystemService", "power", "java.lang.String")
Return R.RunMethod("isScreenOn")
End Sub
with this in the "what ever activity" activity resume and pause
B4X:
Dim r As Reflector
r.Target = r.GetActivity
r.Target = r.RunMethod("getWindow")
r.RunMethod2("addFlags", 6815872, "java.lang.int")
and the release
B4X:
Dim r As Reflector
r.Target = r.GetActivity
r.Target = r.RunMethod("getWindow")
r.RunMethod2("clearFlags", 6815872, "java.lang.int")
works great on Android 5 but on Android 7 it does not wake the phone.
Any pointers as to why appreciated