Help With startservice
Hello:
I did that "Startservice(interceptor)" in activity,Sub PE_PhoneStateChanged (, even with a button with no luck
by the way is the "interceptor" the "app name" or the "PE" As PhoneEvents ?
and where does it go ?
Phone runs the app but when phone rings app goes away and regular screen comes up, after hangup phone finds debugger and load app.
maybe thats the problam.
here it is:
Thank you for your HELP
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim PE As PhoneEvents
Dim strNumber As String
Dim strState As String
End Sub
Sub Service_Create
End Sub
Sub Service_Start
End Sub
Sub Service_Destroy
End Sub
Sub PE_PhoneStateChanged (State As String, IncomingNumber As String, Intent1 As Intent)
strNumber = IncomingNumber
strState = State
'State - One of the three values: IDLE, OFFHOOK, RINGING. OFFHOOK means that there is a call or that the phone is dialing.
'Then something like:
If strState = "RINGING" Then
EditText1.Text = strNumber
End If
If strState = "IDLE" Then
EditText1.Text = "IDLE"
End If
If strState = "OFFHOOK" Then
EditText1.Text = "OFFHOOK"
End If
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim EditText1 As EditText
Dim Panel1 As Panel
Dim Button1 As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Caller")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button1_Click()
StartService("PE")
End Sub