Android Question xCustomListView adding panels slow in Debug mode

wimpie3

Well-Known Member
Licensed User
Longtime User
I'm using xCustomListView to add a LARGE amount of panels.

B4X:
for i = 0 to 100000
        Dim p As B4XView = xui.CreatePanel("")
        p.SetLayoutAnimated(0, 0, 0,myxCustomListView.asview.Width, myxCustomListView.asview.height)
        myxCustomListView.Add(p, someCustomData)
next

Don't worry, I'm using lazy loading to fill these panels afterwards. But they need to be created before they can be filled...

Now my question is: in debug mode, it takes like ages to create all these panels and this even causes my phone to ask me if the app should be killed.
In release mode, things are super fast, and it doesn't even take a second to create all these panels!

I was wondering if I'm doing something wrong here. I definitely need to be able to debug my app, but I can hardly wait so long each time. So how can the performance in Debug mode be improved?

EDIT: just relaunched B4A and the speed is back to normal... strange!
 

Alexander Stolte

Expert
Licensed User
Longtime User
B4X:
Dim Count as Int = 100000
#If Debug
Count = 10
#End If
for i = 0 to Count
        Dim p As B4XView = xui.CreatePanel("")
        p.SetLayoutAnimated(0, 0, 0,myxCustomListView.asview.Width, myxCustomListView.asview.height)
        myxCustomListView.Add(p, someCustomData)
next
i doubt you need all the items in debug mode.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…