'Finds if an app is installed and returns the starting intent
Private Sub ShowInstalledApps(FindApp As String) As Intent
Dim RetCd As Intent
Dim pm As PackageManager 'phone library
' Try
' RetCd = pm.GetApplicationIntent(FindApp) 'look immediately and return if exists
' Return RetCd
' Catch
' Log("ShowInstalled error: "& FindApp & " - " & LastException)
' End Try
For Each pck As String In pm.GetInstalledPackages 'search through the installed apps, fallback
Dim Name As String = pm.GetApplicationLabel(pck)
' Dim imgv As ImageView
' imgv.Initialize("imgv")
' imgv.Background = pm.GetApplicationIcon(pck)
If Name.ToLowerCase.Contains("print") Then
RetCd = pm.GetApplicationIntent(pck)
Log(Name & " Intent: " & RetCd)
End If
Next
Return RetCd
End Sub