launch application
Monkey Forums/Monkey Beginners/launch application| 
 | ||
| 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 | 
| 
 | ||
| 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
#EndIfExternal 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") | 
| 
 | ||
| Thanks Have these errors : (all my application extern java file) imports ? | 
| 
 | ||
| The word "package" is a Java keyword I think. That was my bad. Just change that to something else like, "appPackage", or something. | 
| 
 | ||
|  | 
| 
 | ||
| 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 ! | 
| 
 | ||
| perhaps miss some BBAndroidGame things ? | 
| 
 | ||
| i need some help with this. Could somebody help me ? Apologize to bump this and many thanks if you have some ideas ! |