Android Question Opening Apps With a Launcher

treehousefrog

Member
Licensed User
Longtime User
Hey guys,

So I've made a launcher which lists installed packages and then lets you launch them (as launchers tend to do...). The problem is that certain apps don't launch - such as the default dialer and a few others.

The problem I think is with pm.getapplicationintent(packagename). In other words, doing this doesn't let me start the dialer:

B4X:
Dim il As Intent
il = pm.GetApplicationIntent (PHONE PACKAGE)
StartActivity (il)

But this does:

B4X:
Dim inn As Intent
inn.Initialize(inn.ACTION_VIEW, "tel:")
StartActivity(inn)

The same problem exists with a number of other apps...

I'm not sure how other launchers get around this issue, but the best way I can think to figure it out is to list what intents a given package accepts and then shoot off one of those. Is there a way I can list the intents that a package will accept? And if not, what other method can you guys recommend? Thanks so much in advance!
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
What is the output of pm.GetApplicationIntent for the phone app?

You can see the "correct" intent in the unfiltered logs when you start the dialer:
START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.google.android.dialer/com.android.dialer.DialtactsActivity bnds=[56,1040][184,1168]} from pid 833
 
Upvote 0
Top