ander47 Member Jan 20, 2022 #1 hi! please help me whith library PHONE... I write the call code by number when I press the button. But my code doesn't work. I get errors in the debugger my code is: Sub Class_Globals Private Root As B4XView Private xui As XUI End Sub Public Sub Initialize End Sub Sub Activity_Create(FirstTime As Boolean) If FirstTime Then End If End Sub Private Sub Button1_Click Dim p As PhoneCalls StartActivity(p.Call("123456789")) End Sub error debugger in files... Attachments error.jpg 221.1 KB · Views: 373
hi! please help me whith library PHONE... I write the call code by number when I press the button. But my code doesn't work. I get errors in the debugger my code is: Sub Class_Globals Private Root As B4XView Private xui As XUI End Sub Public Sub Initialize End Sub Sub Activity_Create(FirstTime As Boolean) If FirstTime Then End If End Sub Private Sub Button1_Click Dim p As PhoneCalls StartActivity(p.Call("123456789")) End Sub error debugger in files...
JohnC Expert Licensed User Longtime User Jan 20, 2022 #2 You can try this: B4X: Dim I As Intent I.Initialize(I.ACTION_CALL, "tel:" & phonenumber) StartActivity(I) And make sure you have this in your manifest: B4X: AddPermission(android.permission.CALL_PHONE) And have this for the runtime permission: B4X: Dim RP As RuntimePermissions RP.CheckAndRequest(RP.PERMISSION_CALL_PHONE) Wait For Activity_PermissionResult (Permission As String, AskResult As Boolean) Upvote 0
You can try this: B4X: Dim I As Intent I.Initialize(I.ACTION_CALL, "tel:" & phonenumber) StartActivity(I) And make sure you have this in your manifest: B4X: AddPermission(android.permission.CALL_PHONE) And have this for the runtime permission: B4X: Dim RP As RuntimePermissions RP.CheckAndRequest(RP.PERMISSION_CALL_PHONE) Wait For Activity_PermissionResult (Permission As String, AskResult As Boolean)
ander47 Member Jan 20, 2022 #3 sorry, but this not work. the application closes with an error Upvote 0
ander47 Member Jan 20, 2022 #4 JohnC said: AddPermission(android.permission.CALL_PHONE) Click to expand... this is paste in file manifest.xml ? Upvote 0
JohnC said: AddPermission(android.permission.CALL_PHONE) Click to expand... this is paste in file manifest.xml ?
JohnC Expert Licensed User Longtime User Jan 20, 2022 #5 ander47 said: this is paste in file manifest.xml ? Click to expand... Yes Upvote 0
klaus Expert Licensed User Longtime User Jan 20, 2022 #6 Where is your Button defined ? You do not load any layout, nor define and add the Button in the code. Upvote 0
Where is your Button defined ? You do not load any layout, nor define and add the Button in the code.
ander47 Member Jan 20, 2022 #7 thank you! my code is work! my problem is - uploaded additional files in sdk manager Upvote 0
ander47 Member Jan 20, 2022 #9 Private Sub Button1_Click Dim p As PhoneCalls StartActivity(p.Call("89259644311")) Dim CurrentCall As SipAudioCall If CurrentCall.IsInCall == 1 Then CurrentCall.SendDtmf(2) End If End Sub but this code is no work( Upvote 0
Private Sub Button1_Click Dim p As PhoneCalls StartActivity(p.Call("89259644311")) Dim CurrentCall As SipAudioCall If CurrentCall.IsInCall == 1 Then CurrentCall.SendDtmf(2) End If End Sub but this code is no work(
DonManfred Expert Licensed User Longtime User Jan 20, 2022 #10 Please use Code Tags when posting code. Additional you should create a new thread for any new question. One thread should summarize one Question. Upvote 0
Please use Code Tags when posting code. Additional you should create a new thread for any new question. One thread should summarize one Question.
toby Well-Known Member Licensed User Longtime User Jan 20, 2022 #11 No permission nor change to manifest is needed to make phone call via intent Upvote 0