I don't think that it is related to the receiver priority. Add a Log message. I guess that you will see that your service is running. In that case you can add a delay of a few seconds before starting the activity.
I am currently working on my app which also needs to display itself on top of the calling screen for both cases of incoming and outgoing calls, i.e. the user will see only my app not the calling screen. What I do is to intercept the call - by using PhoneStateListener for incoming and intent for outgoing - and have a timer, then every time when there is a call it will enable the timer, which in its turn will trigger the kiosk mode of my app (look at "kiosk mode" sample by Erel) by calling StartActivity. When the call ends (or is stopped by the user), the timer will be disabled. By doing so, I can display my app for 100% of cases and the user can interact with my app instead of seeing the calling screen.
In other words, the calling screen is still there but it is "hidden" by my app which is on top of the screen. Just to make sure that once your app pop up it is in full screen mode.
I am not sure I understand correctly your question, but hope my case can help you.
On a Service, that we can call "S1", put this code:
B4X:
Sub Process_Globals
Dim PE As PhoneEvents
End Sub
Sub PE_PhoneStateChanged (State As String, IncomingNumber As String, Intent As Intent)
Dim PhoneFlag
If State = "RINGING" AND IncomingNumber<>"" Then 'incoming call
PhoneFlag = 1
End If
If State = "OFFHOOK" AND PhoneFlag = 1 Then 'answering to incoming call
PhoneFlag = 2
End If
If State = "OFFHOOK" AND IncomingNumber="" AND PhoneFlag <> 2 Then 'out call
StartActivity(youractivityname) ' here you launch your screen
End If
End Sub
maybe you can use something like this...
if you know you will have to press 2...
you can dial number like this: "number,2"
"," - mean pause
you can add "," more than just one...like "number,,2" to wait a little more
or even "number,1,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.