Android和PhoneGap的:意图发动其他应用意图、Android、PhoneGap

2023-09-06 16:24:31 作者:盯着贞子唱咆哮

我发现这个code推出,意图在浏览器:

I found this code to launch the browser with an intent:

Intent intent = new Intent (Intent.ACTION_VIEW, uri);
intent.setClassName("com.android.browser", "com.android.browser.BrowserActivity");
intent.setDataAndType(uri, "text/html");
startActivity(intent);

它的工作原理。

但我不能使用Android SDK。我使用PhoneGap的,使我的应用程序。所以我在寻找一种方式来推出这个意图。我发现这个插件: https://github.com/borismus/phonegap-plugins/tree/主/ Android的/ WebIntent /

But i'm not using Android SDK. I'm using Phonegap to make my application. So i'm looking for a way to launch this intent. I found this plugin: https://github.com/borismus/phonegap-plugins/tree/master/Android/WebIntent/

但不允许setClassName,setDataAndType....

But it does not allow to "setClassName", "setDataAndType"....

任何想法?

推荐答案

如果你只是想在Android浏览器加载一个URL,那么你应该只使用ChildBrowser插件:

If you just want to load a url in the Android browser then you should just use the ChildBrowser plugin:

https://github.com/phonegap/phonegap-plugins/树/主/ Android版/ ChildBrowser

如果您正在寻找启动任何意图则只是让我知道由于Android的PhoneGap code推出了各种意图的完成工作。

If you are looking to start any intent then just let me know as the Android PhoneGap code launches all sorts of intents to get work done.