iOS Question Dialog box

ginsh

Member
Licensed User
Longtime User
Hi,

Any one please let me know how to keep the dialog box displayed till the user enters the correct password. The dialog box only has "OK" button. The attached code I tried was the CustomDialog Example.


B4X:
Do While txtFirstName.Text <> Pass
        
        Dim sf As Object = DetailsDialog.ShowAsync("Please enter the password", "OK", "", "", False)
        DetailsDialog.GetButton(DetailsDialog.RESULT_POSITIVE).Enabled = False
        Wait For (sf) Dialog_Result (Result As Int)
        'disable the OK button.

        If Result = DetailsDialog.RESULT_POSITIVE Then
        
            If txtFirstName.Text <> Pass Then
                hd.ToastMessageShow("Wrong Password",True)
                

            End If
        
        'Else If Result = DetailsDialog.RESULT_NEGATIVE Then
        
    
        
        End If
    
    Loop
 

Attachments

  • Dialogbox.zip
    467.4 KB · Views: 160

Brandsum

Well-Known Member
Licensed User
  1. Set auto cancelable false
  2. Don't use dialog inbuilt buttons, create your own as you are using custom dialog
  3. After work is done close the dialog by code and you will get the result in wait for function
Check this
 

Attachments

  • Dialogbox_modified.zip
    3.7 KB · Views: 163
Upvote 0
Top