Android Question B4XDialog: Long Delays in Debug Mode

epiCode

Active Member
Licensed User
I am using B4XDialog and during debugging it takes a lot of time (sometimes up to 2 minutes or more) when passing over b4xdialog lines. Release mode delay is also present but it looks like a negligible lag and not a long delay.
A little debugging led me to find out that it is taking this time when it comes to this loop in B4XDialog:

B4X:
Public Sub ShowCustom (Content As B4XView, Yes As Object, No As Object, Cancel As Object) As ResumableSub
    For Each v As B4XView In mParent.GetAllViewsRecursive
        If v.Tag <> Null And v.Tag = "b4xdialog_background" Then
            v.RemoveViewFromParent
            Exit
        End If
    Next

I understand that this specific loop looks for existing b4xdialog in parent recursively and removes it before adding a new one.
Is it possible to reduce the loop time somehow ?
 
Last edited:
Top