Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/206.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从网页启动android应用程序_Android_Android Intent - Fatal编程技术网

从网页启动android应用程序

从网页启动android应用程序,android,android-intent,Android,Android Intent,我有两份申请,AppOne和AppTwo AppOne是一个简单的应用程序,它可以导出一个活动,以便通过以下意图过滤器从网页启动该活动 <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:n

我有两份申请,AppOne和AppTwo

AppOne是一个简单的应用程序,它可以导出一个活动,以便通过以下意图过滤器从网页启动该活动

<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="what should be the host for a local page?"
                android:scheme="what should be the scheme?" />
</intent-filter>

具体来说,我想知道

  • 本地加载的页面的主机名应该是什么
  • 根据场景,方案应该是什么

  • 谢谢

    这个方案可以是你想要的任何东西-所以选择一个对你的应用程序有意义的词,比如“apptwo”

    如果您的方案是唯一的,则不需要在意图过滤器的数据部分指定主机。如果您只是将链接用作触发器(即始终加载相同的页面index.htm),那么URL的其余部分是什么并不重要

    在AppTwo中,当意图触发时,您只需安排将相关文件加载到webview中

    <a href="apptwo://trigger">launch app</a> 启动应用程序</a>
    谢谢你的回复。我在某个地方读到,使用你自己的方案不是一个好主意。 <a href="apptwo://trigger">launch app</a>