Android Question PackageManager.QueryIntentActivities

artsoft

Active Member
Licensed User
Longtime User
Hi all!

This code ...

B4X:
Dim i As Intent
i.Initialize("android.intent.action.SEND", "")
i.SetType("application/zip")

Dim installedPackages As List = pm.QueryIntentActivities(i)

If (installedPackages.Size > 0) Then
    For Each package As String In installedPackages
        Log(package)
    Next
End If

... always logs the relevant packages in this format:

packageName/activity

Is there any other method or function that provides only the packageName?

Thx in advance for every answer :)
 

drgottjr

Expert
Licensed User
Longtime User
not with the phone library as written.
the list returned by queryintentactivities is a list of strings representing the package name and the class of activities which can handle your intent. the "/" can be used as a delimeter. everything that is to the left of the "/" is the package name. just use what's on the left.

if that is too involved, you can write your own little queryintentactivities method in java or with javaobject. you can make it return only a list of package names.
 
Upvote 0
Top