mjtaryan Active Member Licensed User Longtime User Aug 10, 2012 #1 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. Thanks.
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. Thanks.
M Mahares Expert Licensed User Longtime User Aug 10, 2012 #2 Did you have something like this in mind? I learned it from Erel. Replace packagename with your packagename: Code: Copy Dim MyIntent as Intent MyIntent.Initialize(MyIntent.ACTION_MAIN, "") MyIntent.SetComponent("packagename/.main") StartActivity(MyIntent) Upvote 0
Did you have something like this in mind? I learned it from Erel. Replace packagename with your packagename: Code: Copy Dim MyIntent as Intent MyIntent.Initialize(MyIntent.ACTION_MAIN, "") MyIntent.SetComponent("packagename/.main") StartActivity(MyIntent)
mjtaryan Active Member Licensed User Longtime User Aug 10, 2012 #3 Mahares said: Did you have something like this in mind? I learned it from Erel. Replace packagename with your packagename: Code: Copy Dim MyIntent as Intent MyIntent.Initialize(MyIntent.ACTION_MAIN, "") MyIntent.SetComponent("packagename/.main") StartActivity(MyIntent) Click to expand... A couple of questions: 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. Thanks. Upvote 0
Mahares said: Did you have something like this in mind? I learned it from Erel. Replace packagename with your packagename: Code: Copy Dim MyIntent as Intent MyIntent.Initialize(MyIntent.ACTION_MAIN, "") MyIntent.SetComponent("packagename/.main") StartActivity(MyIntent) Click to expand... A couple of questions: 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. Thanks.
M Mahares Expert Licensed User Longtime User Aug 10, 2012 #4 You are correct on both questions. Upvote 0
mjtaryan Active Member Licensed User Longtime User Aug 12, 2012 #5 Another question. In your example you have a line MyIntent.Initialize(MyIntent.ACTION_MAIN,"") 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. Upvote 0
Another question. In your example you have a line MyIntent.Initialize(MyIntent.ACTION_MAIN,"") 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.
M Mahares Expert Licensed User Longtime User Aug 12, 2012 #6 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 Code: Copy Dim Intent1 As Intent Intent1.Initialize(Intent1.ACTION_MAIN, "") Intent1.SetComponent("com.google.android.youtube/.HomeActivity") StartActivity(Intent1) Upvote 0
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 Code: Copy Dim Intent1 As Intent Intent1.Initialize(Intent1.ACTION_MAIN, "") Intent1.SetComponent("com.google.android.youtube/.HomeActivity") StartActivity(Intent1)
mjtaryan Active Member Licensed User Longtime User Aug 13, 2012 #7 Thank you. You've been a significant help. Upvote 0