Is there a simple and direct way for an app (or service) to call, that is start, another app that is not currently running? I'm thinking of something like
StartApp(AppName As String, Activity As String)
The above asumes first that AppName is known and is installed.
1. Why the forward slash ("/")? Is it required?
2. Am I correct that ".Main" is the activity being called? That is, if I wated to call a different activity, I could replace ".Main" with ".AnotherAcivitiy"?
If the answer to number 2 above is that I am correct in my understanding, then I suppose this will do what I need.
I came across some similar but more involved code in another thread somewhere that called and listed the PackageManager and then listed the packages (I assume the user was to pick one to run). I don't need that. My need is much simpler.
What is "ACTION_MAIN" and does it have anything to do with the activity "Main" in the call to the pacage? If so, then should "_MAIN" be replaced with the activity name I want to start? Thanks so much.
I do not think that the MAIN in ACTION_MAIN you refer to has anything to do with the name of the app you are launching. There is ACTION_MAIN, ACTION_VIEW, etc. Here is a link to some code that launches a module with a name other than MAIN, but uses ACTION_MAIN in the intent. Intent - Basic4android Wiki
B4X:
Dim Intent1 As Intent
Intent1.Initialize(Intent1.ACTION_MAIN, "")
Intent1.SetComponent("com.google.android.youtube/.HomeActivity")
StartActivity(Intent1)