phone lib question (PhoneStateChanged ignored?)
Hi, and sorry if it's a silly question
In this code, I can see Battery and Screen events, but with PE_PhoneStateChanged I can't get any info
B4A 2.02; Phone lib 1.91
In Manifest, i added:
Thank you
Hi, and sorry if it's a silly question
In this code, I can see Battery and Screen events, but with PE_PhoneStateChanged I can't get any info
B4A 2.02; Phone lib 1.91
In Manifest, i added:
B4X:
AddPermission(android.permission.READ_PHONE_STATE)
addpermission(android.permission.CALL_PHONE)
B4X:
'main
Sub Process_Globals
End Sub
Sub Globals
End Sub
Sub Activity_Create(FirstTime As Boolean)
StartService(llamando)
End Sub
B4X:
'Service -llamando- module
Sub Process_Globals
Dim PE As PhoneEvents
End Sub
Sub Service_Create
PE.Initialize("PE")
End Sub
Sub Service_Start
End Sub
Sub PE_BatteryChanged (Level As Int, Scale As Int, Plugged As Boolean, Intent As Intent)
Log("BatteryChanged: Level = " & Level & ", Scale = " & Scale & ", Plugged = " & Plugged)
End Sub
Sub PE_ScreenOff (Intent As Intent)
Log("ScreenOff")
End Sub
Sub PE_ScreenOn (Intent As Intent)
Log("ScreenOn")
End Sub
Sub PE_PhoneStateChanged(State As String, IncomingNumber As String, Intent As Intent) As String
Log("PhoneStateChanged, State = " & State & ", IncomingNumber = " & IncomingNumber)
Log(Intent.ExtrasToString)
Log(Intent.ACTION_CALL)
End Sub
Sub Service_Destroy
End Sub
Thank you
Last edited: