gpt4 book ai didi

android - 在手机浏览器中打开时,我们如何从 html 按钮打开 android 应用程序

转载 作者:行者123 更新时间:2023-11-29 01:42:13 24 4
gpt4 key购买 nike

如果 html 页面在 android 手机浏览器中打开,我只需要在单击 html 页面的按钮时打开应用程序。

对不起我的英语。

请推荐。

提前致谢

最佳答案

你可以设置intent-filterMain-activity您的应用程序如下从浏览器打开此应用程序。

 <activity
android:name="activity_name">
<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="example.com"
android:scheme="http" />
<data
android:host="www.example.com"
android:scheme="http" />
</intent-filter>
</activity>

编辑:如果你写了<intent-filter>如上所述您的 Activity 然后您可以在 html 按钮上打开您的应用程序单击如下。

点击 html 页面按钮调用 url http://www.example.com

例子:

<input type=button onClick="parent.location='http://www.example.com'" value='Open App'>

关于android - 在手机浏览器中打开时,我们如何从 html 按钮打开 android 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23777939/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com