Hello,
from my program I need to run another application,
so I have found this code:
B4X:
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
Ok, but program name that I need to lunch is "ilMeteo", but how can I found "com.package.tolaunch" of this program ???
Hello,
from my program I need to run another application,
so I have found this code:
B4X:
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
Ok, but program name that I need to lunch is "ilMeteo", but how can I found "com.package.tolaunch" of this program ???
For example, if you want to run AirDroid you do this:
B4X:
Sub YourButton_Click
Try
Dim Intent1 As Intent
Dim pm as PackageManager
Intent1 = pm.GetApplicationIntent("com.sand.airdroid")
StartActivity (Intent1)
Catch
ToastMessageShow("Failed to launch app! Is it installed?", True)
End Try
End Sub
Try use this strategy as below,if you want to run ilMeteo
B4X:
Dim i as Intent
Dim Pm As PackageManager
Dim Packages As List
Dim st As String
Dim k As Int
Packages = Pm.GetInstalledPackages
For k = 0 To Packages.size - 1
st=Packages.Get(k)
If st.Contains("ilMeteo") =True Then
i=Pm.GetApplicationIntent(st)
If i.IsInitialized Then
StartActivity(i)
Exit
End If
End If
Next