Android意图过滤器无法从浏览器启动应用程序 [英] Android intent filter not launching app from browser

查看:112
本文介绍了Android意图过滤器无法从浏览器启动应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个非常奇怪的问题……上周,如果调用了某个URL,我将使用该意图过滤器从浏览器启动我的应用程序.当时效果很好.今天,它将不再启动我的应用程序.

This is a really strange problem... last week I was using this intent filter to launch my app from the browser if a certain URL was called. It worked fine then. Today, it won't launch my app anymore.

这是意图过滤器:

        <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="web1.tunnlr.com"
                    android:port="12257"
                    android:pathPattern=".*androidapp.*"
                    android:scheme="http" />

        </intent-filter>

正如您所看到的,我只是在这里使用一个测试站点.当加载页面 http://web1.tunnlr.com/androidapp 的重定向发送到用户的浏览器之前,它会显示一个选择对话框,您可以在其中使用浏览器(因为http方案总是被浏览器捕获)或我的应用打开页面.现在,它只是停留在浏览器上.我从来没有为浏览器做过记住我的选择"之类的事情来处理这种意图,并且甚至卸载并重新安装了该应用程序以确保不是这种情况.

I'm just using a test site here as you can see. When the redirect which loads up the page http://web1.tunnlr.com/androidapp is sent to the user's browser, before it would give a little chooser dialog where you could either open the page with your browser (because http schemes are always caught by the browser) or my app. Now, it just stays on the browser. I never did anything like "remember my selection" for the browser to handle this intent, and I've even uninstalled and fresh reinstalled the app to make sure that wasn't the case.

有人可以看到这个意图过滤器有问题吗?

Can anyone see an issue with this intent filter?

此外,这是我从重定向返回的确切网址,应该会触发意图过滤器.

Also, here is the exact url I get back from the redirect, which should trigger the intent filter.

http://web1.tunnlr.com/androidapp

推荐答案

如果您尚未更改意图过滤器,那么我想您可能会不小心将浏览器始终设置为处理该意图.

If you haven't changed the intent filter, then I would guess you accidentally set the browser to handle this intent all the time.

您可以通过以下方法清除此设置:进入设置">应用">浏览器">清除默认设置"

You can clear this by going Settings > Apps > Browser > Clear defaults

这篇关于Android意图过滤器无法从浏览器启动应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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