lv.Clear
Dim pm As PackageManager
Dim packages As List
packages = pm.GetInstalledPackages
Dim k As Int
Dim n As Int = packages.Size- 1
For i = 0 To n Step 20 ' step each 20
k = i + 19
' check if we're nearing the end to prevent out of bounds errors
If k >= n Then k = n - i
For j = 0 To k
Dim p As String = packages.Get(i)
Dim bdw As BitmapDrawable = pm.GetApplicationIcon(p)
lv.AddTwoLinesAndBitmap(pm.GetApplicationLabel(p),packages.Get(i),bdw.Bitmap)
Next
Next