Zeev Goldstein Well-Known Member Licensed User Longtime User Jan 25, 2023 #1 Hi 2 questions on intent: 1. Is there a way to determine if intent I called is still running or ended? How? 2. My app calls intent, is there a way that intent will return data to my app? Thanks edit: can any simple app run from another app? i want my app to load another app (also mine) and wait in background until the loaded is done as simple as that whatever i try i get error that the second app is not found - it is installed on the phone... it does not have to intent - any other way to load and run the second app will do this is the code Code: Copy Dim MyIntent As Intent Try MyIntent.Initialize(MyIntent.ACTION_VIEW, "") MyIntent.SetType("MyAppName") StartActivity(MyIntent) Catch Log("error: " & LastException.Message) End Try Last edited: Jan 25, 2023
Hi 2 questions on intent: 1. Is there a way to determine if intent I called is still running or ended? How? 2. My app calls intent, is there a way that intent will return data to my app? Thanks edit: can any simple app run from another app? i want my app to load another app (also mine) and wait in background until the loaded is done as simple as that whatever i try i get error that the second app is not found - it is installed on the phone... it does not have to intent - any other way to load and run the second app will do this is the code Code: Copy Dim MyIntent As Intent Try MyIntent.Initialize(MyIntent.ACTION_VIEW, "") MyIntent.SetType("MyAppName") StartActivity(MyIntent) Catch Log("error: " & LastException.Message) End Try
Zeev Goldstein Well-Known Member Licensed User Longtime User Jan 25, 2023 #2 gotch! problem solved managed to run the second app now i just need to know if it is still running or ended should i loop and wait for some time or is there a way to detect if it is still running and freeze until it ends? Upvote 0
gotch! problem solved managed to run the second app now i just need to know if it is still running or ended should i loop and wait for some time or is there a way to detect if it is still running and freeze until it ends?
DonManfred Expert Licensed User Longtime User Jan 25, 2023 #3 Zeev Goldstein said: gotch! problem solved Click to expand... Where is the solution? It isn´t helpful if you don´t share the solution Upvote 0
Zeev Goldstein said: gotch! problem solved Click to expand... Where is the solution? It isn´t helpful if you don´t share the solution
Zeev Goldstein Well-Known Member Licensed User Longtime User Jan 25, 2023 #4 and this is the solution that works for me Code: Copy Dim pm As PackageManager Dim in As Intent Try in.Initialize("","") in=pm.GetApplicationIntent("AppName") If in.IsInitialized Then StartActivity(in) End If Catch Log("error: " & LastException.Message) End Try appname is NOT the app name shown in launcher, it is the package name like com.blabla.bla etc... now just the waiting and i'm done... Upvote 0
and this is the solution that works for me Code: Copy Dim pm As PackageManager Dim in As Intent Try in.Initialize("","") in=pm.GetApplicationIntent("AppName") If in.IsInitialized Then StartActivity(in) End If Catch Log("error: " & LastException.Message) End Try appname is NOT the app name shown in launcher, it is the package name like com.blabla.bla etc... now just the waiting and i'm done...
DonManfred Expert Licensed User Longtime User Jan 25, 2023 #5 You should expect App A can be killed by Android while still working with App B if android decide to do so. You can send an intent to App A if App B finished to tell App A the finishstate I don´t know any other way to "wait". Upvote 0
You should expect App A can be killed by Android while still working with App B if android decide to do so. You can send an intent to App A if App B finished to tell App A the finishstate I don´t know any other way to "wait".
Zeev Goldstein Well-Known Member Licensed User Longtime User Jan 25, 2023 #6 DonManfred said: You should expect App A can be killed by Android while still working with App B if android decide to do so. You can send an intent to App A if App B finished to tell App A the finishstate I don´t know any other way to "wait". Click to expand... Oops, never thought of android killing my app... App B will be running for max 1 minute and in most cases much less. Is there a way to set my A app as one that may run in background in installation? Maybe through the manifest? (how?) I don't want the user to bother with it... And how B tells A it finished? Thanks Upvote 0
DonManfred said: You should expect App A can be killed by Android while still working with App B if android decide to do so. You can send an intent to App A if App B finished to tell App A the finishstate I don´t know any other way to "wait". Click to expand... Oops, never thought of android killing my app... App B will be running for max 1 minute and in most cases much less. Is there a way to set my A app as one that may run in background in installation? Maybe through the manifest? (how?) I don't want the user to bother with it... And how B tells A it finished? Thanks