It would simplify the code. If I could do something like this.
B4X:
private sub whatever
Private xTest As B4XView = lst_xRotateKnobs.Get(i)
If xTest Is xRotateKnob Then
Public xObject As xTextField
Else If xTest Is xTextField Then
Public xObject As xRotateKnob
End If
' do stuff with the resulting xObject'
end sub