Android Question [SOLVED] B4A Run app from app

Magma

Expert
Licensed User
Longtime User
I thought was simple... tried search all the forum... but not getting the result i want..

My app package is mvt.client - i want it to run it...

B4X:
Dim Intent1 As Intent
        Dim pm As PackageManager
        Intent1 = pm.GetApplicationIntent("mvt.client")
        'Intent1.Initialize(Intent1.ACTION_VIEW,"")
        'Intent1.SetComponent("mvt.client")
        StartActivity(Intent1)

can't make it ... where am i wrong ?
 

DonManfred

Expert
Licensed User
Longtime User
it should work i guess. I mean; if you do not manpulate the manifest to hide the icon or to remove the entrypoint of your app...

Do you get any error?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Can i load app and call specific activity (not run main, but other activity) from intent
Only if your app understand the new entrypoint. Must be defined in manifest somehow. I don´t know how.

The entrypoint of a b4a app is the main activity by default.
Did you manipulated the manifest to hide your app or so? I mean because of the
B4X:
 Dim pm As PackageManager
        Intent1 = pm.GetApplicationIntent("mvt.client")
does not work....
 
Upvote 0

Magma

Expert
Licensed User
Longtime User
No it is not hidden!

I am doing that because i want to load it from a launcher... intent works right or not works ?

Actually i make 2 questions at forum (and thank you for fast answers) because i have 2 apps:

1st app will be the launcher -> for HOME button - and when pressing the user Home will load the 2nd app.
2nd app will be the mvt.client - i don't want to be the launcher (not asking the user for Home button) - that because some user not want to have it as launcher.
 
Upvote 0

Magma

Expert
Licensed User
Longtime User
Just found the error...

I was writing/reading a file from File.DirInternal was ther setup for running specific app from my launcher!!! changing that to DirRootExternal saved MY DAY!

SORRY ! and thank you all guys again.

at app i want to load it there is a 2nd activity not MAIN is it possible without trick to say at intent run specific activity (ROCKING)....


B4X:
Dim pm As PackageManager
Intent1 = pm.GetApplicationIntent("mvt.client/ROCKING")

ofcourse not works.. is there a solution.. ?

A solution thought was writing to external root a file with the name of activity or a text reminds what activity i want...
and then at MAIN / activity_resume read that file and startactivity the ROCKING...

But is there another way at Intent ?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
is there a solution.. ?
You can use the intent, add some extra data to the intent and then start the app. The App starts (for sure in MAIN) and you can check the startingintent and look for the extras.
Depending on the extras you can decide what to do. You can start another activity then if you want. But Main is still the Entrypoint of your app.
 
Last edited:
Upvote 0
Top