Android Question Outgoing call question

somed3v3loper

Well-Known Member
Licensed User
Longtime User
I am not sure I understood your problem but you might want to to use intent filter

Add this to your manifest :
B4X:
AddPermission("android.permission.READ_PHONE_STATE")
AddReceiverText(YourServiceName,
<intent-filter>
    <action android:name="android.intent.action.PHONE_STATE" />
</intent-filter>)

And add this inside service_start

B4X:
    If StartingIntent.HasExtra("state") Then
        If  StartingIntent.GetExtra("state") ="IDLE" Then
            Log("Call has ended")
        End If
    End If
If that is not what you wanted , you might want to modify the code and or check for other extras .

It is called twice and I do not know why .
 
Upvote 0

jefflynn1974

Member
Licensed User
Longtime User
Thanks for the answer, but that is not exactly what I need. I may have written the original post ambigiously.
I would like to interrupt the outgoing call after the user has pressed the dial button so that I can display a message box to give the user a choice. If the user selects 'Yes' the app dials the called number.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
As far as i know you can not intercept an outgoing call or overlap the call-dialog
 
Upvote 0

jefflynn1974

Member
Licensed User
Longtime User
I can catch the outgoing call and abort it with the SetResultdata(null). But the call process in that case is already created with a false number but not interrupted.
 
Upvote 0
Top