Android Question Scroll PCLV to specific index

Thank you Mahares

​

"ArrayIndexOutOfBoundsException: length=0; index=-1", works if sleep(0) changed to sleep(100)
It looks that you tried with an empty CLV.
B4X: Copy
if CustomListView1.GetSize > 0 then CustomListView1.ScrollToItem(CustomListView1.GetSize-1)
 
Upvote 0
Better to have all the code outside the Activity_Create sub.
Move the code outside and just call it at the end of Activity_Create
Example
B4X: Copy
Private Sub FillCLV
    'Fill the CLV
    Sleep(0)
    'Scroll to last item
End Sub
Call it from Activity_Create
B4X: Copy
FillCLV
 
Upvote 0
Back
Top