Sho your code.i want to get some icons of app, show the error info. when press yes button, app can run and show icons
Dim appn(packages.size) As String
Dim pkgn(packages.size) As String
Dim ver(packages.Size) As String
Dim icon As BitmapDrawable
Dim n as int
n=0
For i = 0 To packages.Size - 1
appn(n)=pm.GetApplicationLabel(packages.Get(i))
pkgn(n)=packages.Get(i)
icon=pm.GetApplicationIcon(pkgn(i))
ver(n)=pm.GetVersionName(pkgn(n))
ListView1.AddTwoLinesAndBitmap(appn(n)&" "&ver(n),pkgn(n),icon.Bitmap)
n=n+1
Next
but the listview can show all icons. my another app use the same code. not any errorOne of the package is NOT using a BitmapDrawable as Icon but a Vector one.
You can not show a vectoricon in a BitmapoDrawable.
Dim o As Object = pm.GetApplicationIcon(pkgn(i))
If o Is BitmapDrawable = False The Continue
It seems you've fixed, but in the 2nd line from Erel, "Then" is missing the final "n".BitmapDrawable=False Then
now still show error when run the appB4X:If (o Is BitmapDrawable) = False Then Continue
packages = pm.GetInstalledPackages
Dim appn(packages.size) As String
Dim pkgn(packages.size) As String
Dim ver(packages.Size) As String
Dim o As Object
n=0
For i = 0 To packages.Size - 1
appn(n)=pm.GetApplicationLabel(packages.Get(i))
pkgn(n)=packages.Get(i)
o = pm.GetApplicationIcon(pkgn(i))
If (o Is BitmapDrawable)=False Then Continue
ver(n)=pm.GetVersionName(pkgn(n))
ListView1.AddTwoLinesAndBitmap(appn(n)&" "&ver(n),pkgn(n),o)
n=n+1
Next
ListView1.AddTwoLinesAndBitmap(appn(n)&" "&ver(n),pkgn(n),o.As(BitmapDrawable).Bitmap)