Run app from another app

duneplodder

Active Member
Licensed User
Longtime User
Still fairly new to Basic4Android, but really enjoying the learning process.
A couple of questions:

Say I have 2 separate B4A apps: "FirstApp" & "SecondApp"

Is it possible to run SecondApp from within FirstApp?

Is it possible to run SecondApp (or any other) from a Service?
 

duneplodder

Active Member
Licensed User
Longtime User
I've made progress on this. Some things I've learned:

1. The phone library must be selected in the Libs tab.
2. You need the exact package name - I was getting this slightly wrong & Erel's suggestion helps here. In my example it is "rms.Alarm" - you need the quotes.
3. I was able to run this from Service_Start

Example Code:
B4X:
Dim pm As PackageManager
Dim in As Intent

in.Initialize("","")
in=pm.GetApplicationIntent("rms.Alarm")

   If in.IsInitialized Then 
   StartActivity(in)
   End If
Thanks to Erel & other people's examples.
 
Last edited by a moderator:
Upvote 0
Top