Android Question How to avoid GUI Lags/Freezes?

FrankBerra

Active Member
Licensed User
Longtime User
Hello Everyone

In my app i am loading some stuff (Panels, Labels, ImageViews) in a Scrollview.
While loading, the animations of other elements of the GUI get freezed.

I tryied to use Threading in this way
B4X:
Dim Params(1) As Object
Params(0)="nothing"
ThreadHome.RunOnGuiThread("LoadAllTheStuff", Params)

Where LoadAllTheStuff is the subb that i usually call for loading everything in the ScrollView.

The code above seems to help me a bit. Is there another way to avoid freezes or lags?
 

FrankBerra

Active Member
Licensed User
Longtime User
What is the difference between main and background thread?

I am adding about
- 18 panels
- 19 labels
- 12 different images (loaded with LoadImageSample)
- 1 image loaded one time and recycled 18 times when needed
- 1 edittext
(And in the future there will be more things to load)

This freezes the other animations and touch for about half second
 
Upvote 0
Top