'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
'1 get device phone number, if any
rp.CheckAndRequest("android.permission.READ_PHONE_NUMBERS")
Wait For B4XPage_PermissionResult (Permission As String, blnResult As Boolean)
If blnResult=False Then
ToastMessageShow($"You need to grant Phone permission for the app to function correctly"$, True)
Return
End If
Try
Dim pi As PhoneId
Dim cell As String=pi.GetLine1Number
LogColor("phone #=" & cell, Colors.Blue)
If cell.Length>0 Then
ToastMessageShow("phone #=" & cell, True)
Else
ToastMessageShow("Unable to get phone #", True)
End If
Catch
Log(LastException)
End Try
End Sub