I have the following sub to toggle views visibility
But this line "If Activity.GetView(i).Tag = Mode Then" raises an error
Not all views have tag as I only set the tag value on views that I want to toggle the visibility. What am I doing wrong?
Thanks
B4X:
Sub ToggleViewVisibility(Mode As Int, Visible As Boolean)
Dim i As Int
For i=Activity.NumberOfViews-1 To 0 Step -1
If Activity.GetView(i).Tag = Mode Then
Activity.GetView(i).Visible = Visible
End If
Next
End Sub
But this line "If Activity.GetView(i).Tag = Mode Then" raises an error
LastException java.lang.NullPointerException
Not all views have tag as I only set the tag value on views that I want to toggle the visibility. What am I doing wrong?
Thanks