'Service module
Sub Process_Globals
Dim PE As PhoneEvents
Dim AC As AnswerCall
Dim PhoneId As PhoneId
End Sub
Sub Service_Create
PE.InitializeWithPhoneState("PE",PhoneId)
AC.Initialize("AnswerCall")
Log("Service created")
End Sub
Sub Service_Start
Log("Service started.")
End Sub
Sub PE_PhoneStateChanged (State As String, IncomingNumber As String, Intent As Intent)
Log("PhoneStateChanged, State = " & State & ", IncomingNumber = " & IncomingNumber)
Log(Intent.ExtrasToString)
ToastMessageShow(IncomingNumber,False)
If AC.isRinging == True Then
AC.AnswerPhone
End If
AC.enableSpeakerphone
End Sub
Sub Service_Destroy
End Sub
in that case try registering an intent and then handling it in service create event. This will most probably work in every device.Hi madSac,
Thanks for your example. I tried it, but unfortunately, answercall seems not to work too fine in my SG3... it seems to be a compatibility problem because PE_PhoneStateChanged doesn't activate when an incoming call is present.
Best regards.
ac.enableSpeakerphone
Dim callingmyn As PhoneCalls
StartActivity(callingmyn.Call(mynumber))
ac.enableSpeakerphone