如何通过网络视图拨打移动应用程序?

时间:2014-11-11 05:21:49

标签: android webview hybrid-mobile-app

是否有通过网页中的链接调用移动应用程序的解决方案(我的网页是移动应用程序中的Web视图)。例如,我想在点击链接时拨打facebook app。

2 个答案:

答案 0 :(得分:0)

您需要创建<intent-filter>。见Launch custom android application from android browser

对于最简单的情况,您需要向AndroidManifest.xml添加类似的内容:

<intent-filter>
  <data android:scheme="http" android:host="your-url-.com"/>
  <action android:name="android.intent.action.VIEW" />
</intent-filter>

答案 1 :(得分:0)

你必须在Manifest文件中添加一个Intent过滤器,如下所示 -

<intent-filter>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <data
        android:host="www.tamrakar.in"
        android:path="/test"
        android:scheme="http" />
</intent-filter>

希望这有帮助。