Android Question KeepAlive or PartialLock does can not lockscreen automatic?

hzytsoft

Member
Licensed User
Longtime User
hi all
my app use a Service do smoe fun every 15sec
so i use KeepAlive and PartialLock prevent phone goto sleep
but phone will not lockscreen automatic
how can i prevent phone goto sleep and can lockscreen automatic?
ths all

this is my code
---------------------------
Sub Service_Create
Dim n As Notification
n.Initialize
n.Icon = "icon"
n.Sound = False
n.Vibrate=False
n.SetInfo2("ok","ok","短信宝后台运行中", "ok") 'Change Main to "" if this code is in the main module.
wakelock.KeepAlive(False)
wakelock.PartialLock
Service.StartForeground(1, n)

SQL9.Initialize(File.DirInternal, dbk2, True)
jswh
Log(w)
Log(h)
Log(ss)
timer1.Initialize("Timer1",ss*1000) '10 sec. watchdog
timer1.Enabled = True
PE.InitializeWithPhoneState("PE",PhoneId)
End Sub
Sub Service_Start (StartingIntent As Intent)
StartServiceAt("", DateTime.Now + 120 * DateTime.TicksPerSecond, True)
End Sub
Sub Service_Destroy
'StartServiceAt(Null, DateTime.Now +ss*1000, True)
wakelock.ReleaseKeepAlive
wakelock.ReleasePartialLock
End Sub
 

hzytsoft

Member
Licensed User
Longtime User
phone use
KeepAlive and PartialLock
result cannot
lockscreen and dark screen automatic

how to solve the problem?
 
Upvote 0
Top