I am trying to build a version of sliding panels. I know there are ready-made solutions.
When I try to add a layout to a panel I get the error
java.lang.RuntimeException: java.lang.RuntimeException: Object should first be initialized (ImageView).
This is part of the code
All the views have been added to Main using the designer Tools|generate Members.
I have tried the examples and if I try to add my own layout I get the same error, and I have tried different layouts. The layouts work fine in the projects from which they were copied.
What am I doing wrong?
EDIT: There was a png file missing in the Files folder. Since the file was used in the designer for an imageview I am surprised the compiler didn't complain first. I suppose it's part of learning because it hadn't occurred to me that not finding an image was a reason for an imageview not being initialized.
When I try to add a layout to a panel I get the error
java.lang.RuntimeException: java.lang.RuntimeException: Object should first be initialized (ImageView).
This is part of the code
B4X:
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
For i = 0 To slidePan.Length - 1
slidePan(i).Initialize("slidePan")
Activity.AddView(slidePan(i),0,0,100%x, 100%y)
slidePan(i).SendToBack
Next
slidePan(0).LoadLayout("flowsandtemplayout") '<------------- error here
End Sub
[/COLOR]
I have tried the examples and if I try to add my own layout I get the same error, and I have tried different layouts. The layouts work fine in the projects from which they were copied.
What am I doing wrong?
EDIT: There was a png file missing in the Files folder. Since the file was used in the designer for an imageview I am surprised the compiler didn't complain first. I suppose it's part of learning because it hadn't occurred to me that not finding an image was a reason for an imageview not being initialized.
Last edited: