on ICS KeepAlive(False) is invalid?

PeakW

Member
Licensed User
Longtime User
I used to use KeepAlive(False) or ReleaseKeepAlive to close the screen,but on ICS this is invalid,why?:BangHead:
 

PeakW

Member
Licensed User
Longtime User
Don't know why here with me not, and, there is the following questions
ph1.SetScreenBrightness(0.5)
Log("0.5="&ph1.GetSettings("screen_brightness"))
ph1.SetScreenBrightness(1)
Log("1="&ph1.GetSettings("screen_brightness"))

result:

0.5=184
1=184
 
Upvote 0

PeakW

Member
Licensed User
Longtime User
I want upload the ZIP file,but can't,so i Paste the code!
------------------
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.

End Sub

Sub Globals
Dim ph As PhoneWakeState
Dim ph1 As Phone
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim Timer1 As Timer
Dim Button1,Button2 As Button
Dim Br As Int 'brightness

End Sub

Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
Activity.LoadLayout("1.bal")
ph.KeepAlive(True)
If FirstTime Then

End If
Timer1.Initialize("Timer1",10*1000)
Timer1.Enabled=False
Button1.Initialize("Button1")
Button2.Initialize("Button2")
Br=ph1.GetSettings("screen_brightness")
Log("The current brightness:"&ph1.GetSettings("screen_brightness"))

End Sub
Sub Timer1_tick
ph.KeepAlive(True)
Timer1.Enabled=False
End Sub
Sub Activity_Resume
ph1.SetScreenBrightness(0.3)
End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub Button1_Click
ph.ReleaseKeepAlive
End Sub
Sub Button2_Click
Timer1.Enabled=True
End Sub
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…