Android Question Customlistview slow loading

js486dog

Active Member
Licensed User
Please can you help me to improve the speed of loading the Customlistview ?

I have got only cutsomlistview,
label - where I need to load the text from txt data
and checkbox.

Please look at the attached project.
 

Attachments

Brandsum

Well-Known Member
Licensed User
What happening is your CLV is showing update after adding all the views that's why it seems to be too slow. You can add sleep(0) before For loop ending like this,
B4X:
If str(1) = "T" Then
    p.GetView(1).Checked = True
    Else
    p.GetView(1).Checked = False
End If
Sleep(0) '<-- this
To see the update one by one. Though there are too many unnecessary codes in your uploaded project that is slowing down the whole process, some of those are,
B4X:
Activity.AddView(p, 0, 0, 0, 0) ' line 38
p.RemoveView ' line 43
... 'line 61, 62, 64, 66 and so on
 

js486dog

Active Member
Licensed User
What happening is your CLV is showing update after adding all the views that's why it seems to be too slow. You can add sleep(0) before For loop ending like this,
B4X:
If str(1) = "T" Then
    p.GetView(1).Checked = True
    Else
    p.GetView(1).Checked = False
End If
Sleep(0) '<-- this
To see the update one by one. Though there are too many unnecessary codes in your uploaded project that is slowing down the whole process, some of those are,
B4X:
Activity.AddView(p, 0, 0, 0, 0) ' line 38
p.RemoveView ' line 43
... 'line 61, 62, 64, 66 and so on
Thank you very much Brandsum for your advice.

Already your code "Sleep(0)" incredible forced the loading.
I have deleted also 61 and 62 lines of code.

Again Thank you very much.
 
Top