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
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