B4X:
Sub Activity_Create(FirstTime As Boolean)
Dim Label1 As Label=TestView(1)
Dim Radio1 As RadioButton=TestView(2)
End Sub
Sub TestView (no) As View
Select Case no
Case 1: Dim atView As Label
Case 2: Dim atView As RadioButton
End Select
atView.Initialize("")
atView.Text="good"
Return atView
End Sub
I want to return View (Label, RadioButton) selectively among 1 and 2.
Running the code gives the following error
can someone help
Error description: Current declaration does not match previous one.
Previous: {Type=Label,Rank=0, RemoteObject=True}
Current: {Type=RadioButton,Rank=0, RemoteObject=True}
Error occurred on line: 9
Case 2: Dim atView As RadioButton
Last edited: