Hello. I want to write a function and call it with whatever button I want.how should i write?
Display with photo
I cannot return true or false from the function.
How do I query with the function.
It does this only on permits.
this are my codes. thank you
Error image
Display with photo
I cannot return true or false from the function.
How do I query with the function.
It does this only on permits.
this are my codes. thank you
Error image
B4X:
Sub Perssion_control As ResumableSub ' No Return type
Private rp As RuntimePermissions
If Not(rp.Check(rp.PERMISSION_WRITE_EXTERNAL_STORAGE)) Then
rp.CheckAndRequest(rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
Wait For Activity_PermissionResult (Permission As String, havePermission As Boolean)
If havePermission = False Then
' No Return Type
End If
End If
' No Return Type
Return True
End Sub
Sub Perssion_Ok As Boolean
Private rp As RuntimePermissions
If Not(rp.Check(rp.PERMISSION_WRITE_EXTERNAL_STORAGE)) Then
rp.CheckAndRequest(rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
Wait For Activity_PermissionResult (Permission As String, havePermission As Boolean)
If havePermission = False Then
Return False
End If
End If
Return True
End Sub
Sub Kaydet_Buton_Click
If Perssion_Ok=True Then
Msgbox("Permisson Ok","")
Else
Msgbox("Permisson no","")
End If
End Sub
Last edited: