Android Question Phone state listener not responding

Discussion in 'Android Questions' started by rleiman, Jul 12, 2015.

  1. rleiman

    rleiman Well-Known Member Licensed User

    Hi Everyone,

    I pasted the following code in my service module but when I use the phone it does not execute.

    I also tried to type the sub in manually by typing the word "sub" followed by a space then tab to bring up the pop up list be the phone state listener was not in the list so I'm assuming I did something wrong.

    I made sure the listener is in the library manager and it was there. I also declared it and initialised it and started it listening.

    I thought that just pasting sample sub routine code in would work but it looks like that's not the correct way. Could you tell me how set it up so the listener will run?


    ' In process_globals

    Dim PslPhoneState As PhoneStateListener
    ' In service_create

    ' Listeners.
    ' Callback invoked when device call state changes.
    ' Idle = 0
    ' Ringing = 1
    ' OFFHook = 2
    Sub PslPhoneState_onCallStateChanged (State As Int, incomingNumber As String)

    ToastMessageShow("Call state is: " & State, False)

    If State <> 0 Then
    ToastMessageShow("Phone is in use."False)
    End If
    End Sub
  2. rleiman

    rleiman Well-Known Member Licensed User

    Hi Everyone,

    Just switched to the Phone library from Erel and that works so I will not use the Phone State Listener library.

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice