作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在为 Android 实现基于 phonegap 的应用程序,并希望从 phonegap 应用程序内部调用愤怒的小鸟游戏。经过我的快速研究here和 here我有以下内容:
/src/com.borismus.webintent.WebIntent.java
/www/webintent.js
安卓 list :
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="orientation">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<data android:scheme="com.rovio.angrybirds" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
main.js
function onClickStartAngry() {
window.plugins.webintent.startActivity({
action: WebIntent.ACTION_VIEW,
url: 'have_no_idea'},
function() {};
function() {alert('Failed to open AngryBirds App')};
});
}
我被困在这里,have_no_idea
应该为 url:
编写什么。有什么帮助吗?或者还有其他方法可以从 phonegap 调用其他应用程序吗?
最佳答案
这段 java 代码应该可以工作
Intent LaunchIntent = this.cordova.getActivity().getPackageManager().getLaunchIntentForPackage("com.rovio.angrybirds");
this.cordova.getActivity().startActivity(LaunchIntent);
或尝试使用这 2 个插件中的任何一个来打开应用程序
关于android - PhoneGap - 调用另一个应用程序 (AngryBirds),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16936031/
我正在为 Android 实现基于 phonegap 的应用程序,并希望从 phonegap 应用程序内部调用愤怒的小鸟游戏。经过我的快速研究here和 here我有以下内容: /src/com.bo
我是一名优秀的程序员,十分优秀!