将我的浏览器添加到android的默认浏览器选择列表中? [英] Add my browser in the default browser selection list in android?

查看:249
本文介绍了将我的浏览器添加到android的默认浏览器选择列表中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

遵循如何在android的默认浏览器选择列表中添加我的浏览器?.我在manifest文件中指定了Intent:

Following the suggestions from How to add my browser in the default browser selection list in android?. I have specified my Intent in the manifest file:

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

我还添加了权限:

<uses-permission android:name="android.permission.INTERNET"></uses-permission>

但是,我的浏览器仍未显示在设置中浏览器类别的默认应用程序选项中.

But still my browser is not showing in the default app options for the browser category in the settings.

我是否需要做其他事情才能使我的应用显示在浏览器的默认选项中?

Do I need to do anything else for my app to show up in the default options for browser?

推荐答案

尝试将<category android:name="android.intent.category.BROWSABLE" />作为

如果用户正在查看网页或电子邮件,然后单击文本中的链接,则生成的执行该链接的Intent将需要BROWSABLE类别,因此仅将支持该类别的活动视为可能的动作.

If the user is viewing a web page or an e-mail and clicks on a link in the text, the Intent generated execute that link will require the BROWSABLE category, so that only activities supporting this category will be considered as possible actions.

要通过可点击的链接访问intent-filter,这是必需的.没有它,单击链接将无法解析到您的应用.

It is required in order for the intent-filter to be accessible from a clickable link. Without it, clicking a link cannot resolve to your app.

<activity ...>

    <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:scheme="http" />
        <data android:scheme="https" />
    </intent-filter>

</activity>

.

Android应用链接应用程序将自身指定为给定类型的链接的默认处理程序.如果用户不希望该应用程序成为默认处理程序,则可以从其设备的系统设置中覆盖此行为.

Android App Links on Android 6.0 (API level 23) and higher allow an app to designate itself as the default handler of a given type of link. If the user doesn't want the app to be the default handler, they can override this behavior from their device's system settings.

要为您的应用启用链接处理验证,请在intent-filter标签中设置android:autoVerify="true":

To enable link handling verification for your app, set android:autoVerify="true" in intent-filter tag:

<activity ...>

    <intent-filter android:autoVerify="true">

         ...

    </intent-filter>

</activity>

这篇关于将我的浏览器添加到android的默认浏览器选择列表中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆