Android Question List only launchable packages with packagemanager

apty

Active Member
Licensed User
Longtime User
I am trying to list only apps that can be launched but the list gives me all apps including those that cannot be launched. My code is as below
B4X:
Dim pm As PackageManager
    Dim packages As List
    packages = pm.GetInstalledPackages
  
    For i = 0 To packages.Size - 1
    If   pm.GetApplicationIntent(packages.Get(i))<> Null Then
    lsall.AddSingleLine(pm.GetApplicationLabel(p))
End If

what am i doing wrong?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…