Hi,
Can anyone help me to find out what's going on here, please?
I have some code which is working in several activities throughout my application without any problem, but I have recently added it to another activity (since upgrading to V3.8) and I'm getting an unresolvable error.
In the activity Globals section I declare a ListView object:
Then in the trigger event I have the following code:
At the Activity.AddView point, I get the following error:
"java.lang.ClassCastException: java.lang.String cannot be cast to android.view.View"
For some reason this instance of the code seems to not recognise lstMenu as a valid child view, whereas as I said, it works perfectly everywhere else.
Any ideas?
Thanks
Andrew
Can anyone help me to find out what's going on here, please?
I have some code which is working in several activities throughout my application without any problem, but I have recently added it to another activity (since upgrading to V3.8) and I'm getting an unresolvable error.
In the activity Globals section I declare a ListView object:
B4X:
Dim lstMenu As ListView
Then in the trigger event I have the following code:
B4X:
Dim vw As View = Sender
If lstMenu.IsInitialized AND lstMenu.Visible Then lstMenu.Visible = False
lstMenu.Initialize("lstMenu")
lstMenu.Color = Colors.DarkGray
sMenuMode = "View"
lstMenu.AddSingleLine("Origin")
lstMenu.AddSingleLine("Scale")
lstMenu.AddSingleLine("Stretch")
lstMenu.AddSingleLine("Zoom")
Activity.AddView(lstMenu, vw.left, oVideo.Top, 200dip, 460dip)
lstMenu.Visible = True
At the Activity.AddView point, I get the following error:
"java.lang.ClassCastException: java.lang.String cannot be cast to android.view.View"
For some reason this instance of the code seems to not recognise lstMenu as a valid child view, whereas as I said, it works perfectly everywhere else.
Any ideas?
Thanks
Andrew