Android Question Run App from App

Dogbonesix

Active Member
Licensed User
Longtime User
I have been pretty successful with B4A and have a lot of little apps I have written. So I wanted to write an app with all of my apps. I tried:
-----------
Intent1.Initialize(Intent1.ACTION_VIEW, "file://" & File.DirDefaultExternal & "/Recipe_1.apk")
Try
StartActivity(Intent1)
Catch
ToastMessageShow("Cannot start file. " & CRLF & "Recipe _1", False)
End Try
------------

It does not error but certainly does not run my app (actually, runs some ad for webhosting).

What would be the correct code? It is probably File.DirDefaultExternal but I do not know any thing better. Thanks for the support.
 

Dogbonesix

Active Member
Licensed User
Longtime User
Got It...
This works and if one removes the Remarks - the Package names are presented in the log and it is easy to see exactly what is happening - Thanks for the reply!

Dim Intent1 As Intent
Dim pm As PackageManager
Intent1 = pm.GetApplicationIntent("cci.code.recipe_1")
'Dim Packages As List
'Packages = pm.GetInstalledPackages
'For i = 0 To Packages.Size -1
' Log(Packages.Get(i))
'Next
Try
StartActivity(Intent1)
Catch
ToastMessageShow("Cannot start file. " & CRLF & "Recipe_1", False)
End Try
 
Upvote 0
Top