hi
I have a button in my app, when I press it to do a phone number and call.
I used this code,
B4X:
Sub tel4_Click
Dim result As Int
result = Msgbox2("1530", "Vuoi chiamare la guardia costiera ?", "Si", "", "No", Null)
If result = DialogResponse.Positive Then
Dim i As Intent
i.Initialize(i.ACTION_VIEW, "tel:036275735")
StartActivity(i)
End If
End Sub
Open the dialer, but not start the call.
How do I start the phone call ?
thanks Erel
now everything works except for one number (112) that in Italy is an emergency number and that you call do without credit.
By dialing this number you open the Diale but not start of the call.
Is there any way to overcome this?
If I replace AddPermission(android.permission.CALL_PHONE)
with AddPermission(android.permission.CALL_PRIVILEGED)
tells me that missing android.permission.CALL_PHONE
if I add AddPermission(android.permission.CALL_PRIVILEGED)
does not change anything.
I´d like to make some call (no problem), but now after for example 30 seconds I need to shut down this call. Is there any way to make it without using airplane mode ?
I have a similar, almost equal, problem as at the start of this thread.
My code is as follows
B4X:
Sub BtnTel_Click
Dim Ph As Intent
Ph.Initialize(Ph.ACTION_CALL, TBTel.Text)
StartActivity(Ph)
End Sub
TBTel.Text contains a valid telephone number like + 31553556554.
The program stops at the line StartActivity(Ph) with the message:
Last exception android content ActivityNotFoundException: No activity found to handle intent
I have added AddPermission(android.permission.CALL_PRIVILIGED) with the manifest editor. CALL_PHONE doesn't work either.
Hello,
You have to use the PhoneEvents and check the PhoneStateChanged event. When it changed from IDLE to OFFHOOK and returns to IDLE, you know your call was serviced (of course after having programmatically generated the phone call).
hi Erel
I do not have access to this link
please help me
how can I automatic telephone call by this code :
B4X:
Sub tel4_Click
Dim result As Int
result = Msgbox2("1530", "Vuoi chiamare la guardia costiera ?", "Si", "", "No", Null)
If result = DialogResponse.Positive Then
Dim i As Intent
i.Initialize(i.ACTION_VIEW, "tel:036275735")
StartActivity(i)
End If
End Sub
I have add this code in monifest editor : AddPermission(android.permission.CALL_PHONE) AddPermission(android.permission.CALL_PRIVILEGED)