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?
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0
Top