I'm trying to find out how I can launch a native Android app inside a MGWT app (wrapped into a native Android app with PhoneGap) by clicking on a button (for example).
I've followed the Open another application from your own (intent) and it works great using this code snippet:
Button openAppButton = (Button) findViewById(R.id.openApp);
openAppButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// THIS WORKS GREAT
Intent i = new Intent();
PackageManager manager = getPackageManager();
i = manager.getLaunchIntentForPackage("ch.android.test2");
i.addCategory(Intent.CATEGORY_LAUNCHER);
startActivity(i);
}
});
So basically if I click the button in app1 it opens the native app with namespace "ch.android.test2".
The difference is though that this works just launching a native Android app from within another native Android app. What I need is the same functionality from a PhoneGap app made with MGWT.
How would I have to accomplish this? Thanks for suggestions in advance.