nedium Active Member Licensed User Longtime User Jan 29, 2024 #1 Hello everyone and thank you for your help. Using the following code I can open the application I want, but what I want is to open it without closing my application, or failing that, if there are no more options or it must be closed, I would like it to be reopened or put in the foreground on my screen. application, since the other application that I want to open is not necessary to have in the foreground since I only need the application service. Code: Sub YourButton_Click Try Dim Intent1 As Intent Dim pm as PackageManager Intent1 = pm.GetApplicationIntent ("com.package.tolaunch") StartActivity (Intent1) Catch ToastMessageShow ("Failed to launch app! Is it installed?", True) End Try End Sub thanks for your help
Hello everyone and thank you for your help. Using the following code I can open the application I want, but what I want is to open it without closing my application, or failing that, if there are no more options or it must be closed, I would like it to be reopened or put in the foreground on my screen. application, since the other application that I want to open is not necessary to have in the foreground since I only need the application service. Code: Sub YourButton_Click Try Dim Intent1 As Intent Dim pm as PackageManager Intent1 = pm.GetApplicationIntent ("com.package.tolaunch") StartActivity (Intent1) Catch ToastMessageShow ("Failed to launch app! Is it installed?", True) End Try End Sub thanks for your help
Erel B4X founder Staff member Licensed User Longtime User Jan 30, 2024 #2 If you are calling StartActivity then you are starting a new activity. This means that your app will not be visible. Phone.SendBroadcast is an alternative option but it will only work if the other app exposes a receiver that does what you need. Upvote 0
If you are calling StartActivity then you are starting a new activity. This means that your app will not be visible. Phone.SendBroadcast is an alternative option but it will only work if the other app exposes a receiver that does what you need.