launch application

Monkey Forums/Monkey Beginners/launch application

hub(Posted 2016) [#1]
hi !
i'm searching a way to launch another application from my current monkey project and close my application. the other application is an editor coded with b4a)

(android kitkat).
Thanks


Goodlookinguy(Posted 2016) [#2]
You'll have to 'extern' it yourself (I think. Unless someone already did so.). I found code here that would suggest how you go about launching another program, http://stackoverflow.com/questions/3872063/launch-an-application-from-another-application-on-android#7574735

It would go something like this (did not test, just giving hints essentially)...
#If Lang="java"
Extern
Class Example
    Function LaunchSomething:Void( package:String )
End
Public
#EndIf

External File
class Example
{
    public static void LaunchSomething( String package )
    {
        Intent launchIntent = getPackageManager().getLaunchIntentForPackage(package);
        startActivity(launchIntent);
    }
}


To call it, you would write...
Example.LaunchSomething("com.some.thing")



hub(Posted 2016) [#3]
Thanks
Have these errors :



(all my application extern java file)


imports ?


Goodlookinguy(Posted 2016) [#4]
The word "package" is a Java keyword I think. That was my bad. Just change that to something else like, "appPackage", or something.


hub(Posted 2016) [#5]





hub(Posted 2016) [#6]
perhaps a problem with context ?
http://stackoverflow.com/questions/22396382/cant-find-getpackagemanager-method-in-android

Difficult to understand what's wrong and correct the code for me !


hub(Posted 2016) [#7]
perhaps miss some BBAndroidGame things ?




hub(Posted 2016) [#8]
i need some help with this. Could somebody help me ?
Apologize to bump this and many thanks if you have some ideas !