Android Question Dial phone number

Mostez

Well-Known Member
Licensed User
Longtime User
I have phone numbers displayed on B4Xtable, I want to display phone dial pad with this number, for example when cell long clicked, and user can press dial button on phone dial pad to dial the number, i mean to copy the number from data table, then display dial pad and paste the number on it, is it possible to do this and how?

Thanks
 

JohnC

Expert
Licensed User
Longtime User
B4X:
Dim CallReason As String = "In order for this program to dial phone numbers, your permission is required. The next screen will ask for that permission. If you deny permission, then this program can not dial phone numbers for you"

Sub DialNumber(PhoneNum as String)
    Dim PC As PhoneCalls
    Dim RP As RuntimePermissions
  
    If RP.Check(RP.PERMISSION_CALL_PHONE) = False Then        'if no existing phone call permission
        MsgboxAsync(CallReason,"Call Permission")        'explain why this apps needs call permission
        Wait For MsgBox_Result (Result As Int)

        RP.CheckAndRequest(RP.PERMISSION_CALL_PHONE)        'prompt for permission
        Wait For Activity_PermissionResult (Permission As String, AskResult As Boolean)
        If AskResult = False Then    'user did not give permission
            Return    'abort dial
        End If
    End If

    StartActivity(PC.Call(PhoneNum))     'dial number
  
End Sub
 
Last edited:
Upvote 0
Top