I get an error on this piece of code
selp.left = selp.left + 5dip
in the below sub routine. The error is below the code.
What I think the problem is is that the code is in the loop and then the view/Label is removed. SO how can I test to make sure the view/Label is still valid so this doesn't happen? Any ideas?
java.lang.NullPointerException: Attempt to invoke interface method 'void android.view.ViewParent.requestLayout()' on a null object reference
selp.left = selp.left + 5dip
in the below sub routine. The error is below the code.
What I think the problem is is that the code is in the loop and then the view/Label is removed. SO how can I test to make sure the view/Label is still valid so this doesn't happen? Any ideas?
B4X:
Sub doanimation(selp As Label)
lab.Initialize("")
If lblAnswer.Visible = True Then
If lblTimer.Text >1 Then
Do Until selp.left = lv.Width - 120dip
selp.TextColor = Rnd(Colors.Black, Colors.White)
selp.left = selp.left + 5dip
selp.TextSize = selp.TextSize - 1.99dip
selp.Width = selp.Width -1.9dip
DoEvents
Loop
End If
End If
End Sub