Android Question How to start with 1 count

holyraf

Member
Hi, a little problem here. I just want to start the list count to 1 not 0. Can someone help me? Thanks.

B4X:
Sub Activity_Create(FirstTime As Boolean)

    Activity.LoadLayout("ly_r_list")

    Dim list As List

    list = File.ListFiles(File.DirDefaultExternal)

    For i = 0 To list.Size -1

        Log(list.Get(i))

        lstRC.AddTwoLines2("Road Crash # " & i, "ID: " & list.Get(i),list.Get(i))

    Next

End Sub

Screenshot_20200301_154919[1].jpg
 

holyraf

Member
1. Never use File.DirDefaultExternal. Read about runtime permissions.
2. Don't use ListView. Use xCustomListView instead.

B4X:
lstRC.AddTwoLines2("Road Crash # " & (i + 1), "ID: " & list.Get(i),list.Get(i))

Copy. Thankyou so much Erel :D
 
Upvote 0
Top