我想了解如何通过单击按钮来启动MGWT应用程序内部的原生Android应用程序(用PhoneGap封装到原生Android应用程序中) (例如)。从MGWT(gwt-phonegap)应用程序中打开外部Android应用程序
我跟着Open another application from your own (intent)并使用此代码段的伟大工程:
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);
}
});
所以基本上,如果我点击APP1它打开本机应用程序与命名空间“ch.android.test2”按钮。
不同之处在于,这只是从另一个原生Android应用程序启动原生Android应用程序。我需要的是使用MGWT制作的PhoneGap应用程序的相同功能。
我该怎么做到这一点? 感谢您提前提出建议。
将这段代码包装在一个插件中。 http://docs.phonegap.com/en/2.3.0/guide_plugin-development_android_index.md.html#Developing%20a%20Plugin%20on%20Android –