Android Question CustomListView: Warning #1001: Panel.Layout should only be called ....

Phayao

Active Member
Licensed User
Longtime User
Sorry to ask a trivial question again:
When this warning comes up, it is said that I should add the panel to its parent - HOW ?
I add the panel by code (not Designer) and use:
Dim p as panel
p.initialize("")
p.LoadLayout("customlistview-row")

The parent is the activity itself, but when I use Activity.AddView(p,....) then this works only one time, but I want to add the panel many times in a customlistview. :(
Any help is appreciated,

Chris
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
The problem with loading a layout before the panel was added to its parent is that the panel size is not known at this point. This means that features like anchors and designer script will not work correctly.

If it is not important in this case then just add 'ignore to this line to remove this warning.
If it is important then you need to create another panel and then add this panel to the new panel before you load the layout.
 
Upvote 0
Top