Code Issue In Globals

margret

Well-Known Member
Licensed User
Longtime User
I have an If block as listed below in the Globals sub of the Main Activity. I need to Dim vv based on the SDK being used. This code throws an error and will not run. Can we not use an IF statement in Globals?

B4X:
If ph1.SdkVersion >= 14 Then 
     Dim vv As VideoViewExt
Else 
     Dim vv As VideoView
End If


This is the first instance in the code to Dim vv. I have cleaned the project, etc. B4A seems to ignore the If condition and tries to Dim both vv's.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…