Sub PE_PhoneStateChanged (State As String, IncomingNumber As String, Intent As Intent)
If State = "RINGING" Then
Log("PhoneStateChanged, State = " & State & ", IncomingNumber = " & IncomingNumber)
End If
End Sub
I have the permissions and service set up, so PE_PhoneStateChanged does get called. But the IncomingNumber is missing
Log result:
PhoneStateChanged, State = RINGING, IncomingNumber =
I also needed this. I'd delete the thread but I no longer know how.
B4X:
rp.CheckAndRequest("android.permission.READ_CALL_LOG")
wait for Activity_PermissionResult(permission As String, result As Boolean)
Log("READ_CALL_LOG: " & result)
dim howrings as int =2 'must be 2 or 3... at low specs devices... i use 3... 2 rings is very fast...
dim ring as int = 0
dim ph as string
...
Sub PE_PhoneStateChanged (State As String, IncomingNumber As String, Intent As Intent)
ring=ring+1
Log(ring)
If ring<howrings Then
Return
Else
ring=0
End If
Log("passing to check...")
If State = "RINGING" Then
ph=IncomingNumber.trim
Log(ph)
end if