Getting Activity list on your phone from packages?

kanaida

Active Member
Licensed User
Longtime User
I managed to use the package manager to make a list of apps on my phone much like the apps panel. I'd like to know get activity strings that I can execute though. sorta like some shortcut apps do.

So say I got a package name:
com.android.settings

I want to get it's activities like:
com.android.settings.display
com.android.settings.audio
com.android.settings.network
etc...

It seems that part isn't exactly in the package manager class. Any idea how I could do that?
 

NJDude

Expert
Licensed User
Longtime User
You need to use an intent, like this:
B4X:
Dim in As Intent
Dim pm As PackageManager

in = pm.GetApplicationIntent("com.android.settings")

If in.IsInitialized Then

   in.SetComponent("com.android.settings/.DisplaySettings")
   StartActivity(in)
         
End If

But you need to know the activity name.
 
Last edited:
Upvote 0

kanaida

Active Member
Licensed User
Longtime User
Thanks, but I already know how to start them :) my problem is the second part, getting a list of them so I could basically auto-complete activity names as I type package namespaces in a box...

eg.

I start typing: com.android.settings. and i get a list of activities within that, like display settings, sound etc...

I've seen one app do this on the market called 'Intent Tools', although I want to do it for different reasons, and because other than being able to do that, the app crashes like crazy :)

I guess maybe there's a package information class somewhere that can get me info about a package's internal contents specifically?
 
Upvote 0
Top