Android Intent 在其他应用程序中打开

标签 android android-intent cordova-plugins tel

只要链接中有“tel:”标签,我就会尝试打开我自己的应用程序。 所以我正在使用这样的 intent-filter:

<intent-filter>
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <action android:name="android.intent.action.VIEW" />
    <data android:scheme="tel" />
</intent-filter>

但是当点击一个链接时,我的应用程序会在浏览器中打开(当查看所有打开的应用程序时,我可以在浏览器中看到我的应用程序窗口,以及我已经在后台打开的应用程序)。

我如何判断 Intent (重新)打开我的应用程序而不是在浏览器(或触发 Intent 的其他应用程序)内?

我使用 cordova webintent 插件打开应用程序:

https://github.com/Initsogar/cordova-webintent.git

通过以下调用在 javascript 中实现:

window.plugins.webintent.onNewIntent(returnTelIntent);
window.plugins.webintent.getUri(returnTelIntent);
function returnTelIntent() {};

最佳答案

您需要更改 Android 启动模式。看这里:

http://inthecheesefactory.com/blog/understand-android-activity-launchmode/en

关于Android Intent 在其他应用程序中打开,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29487953/

相关文章:

android - 从另一个 Activity 完成一个 Activity

android - 从其他应用程序接收数据在android中为空

android - HTML5 视频 - 在 Android 设备上精确寻找帧?

android - 在android中显示具有轮播效果的图像

android - 丢失了 keystore 的密码

android - volley imageCache 和 imageRequest 都缓存图像

javascript - 如何在 HTML 脚本标签中导入 JavaScript 变量

android - 哪些文件提交到 Android Studio 项目中的版本控制 svn

android - 关于 Intent 的后期运行时绑定(bind)

android - 通过 Facebook Messenger 应用程序分享 - ionic Framework/Cordova apache