Android应用程序不使用意图过滤器从URL打开 [英] Android app not opening from URL using intent-filter

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

问题描述

我试图从一个网站打开我的应用程序和读取链接一些文字。该URL会像 codespike.com /?code = XXXX 。我需要阅读 XXX 但我的问题是,我无法打开我的应用程序时,在这个特定的URL在浏览器中被打开。为了测试我还使用了一个网站 bfinstafollowers.com ,不是这方面的工作无论是。
这就是我想。

I am trying to open my app from a website and read some text from link. The URL will be like codespike.com/?code=xxxx. I need to read the xxx but my problem is that I am not able to open my app when this specific URL in being opened in the browser. For testing I also used a webiste bfinstafollowers.com, not working with this either. This is what I am trying.

<activity
            android:name="com.softech.betforinstafollowers.MainActivity"
            android:label="@string/app_name"
            android:screenOrientation="portrait" >
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:host="bfinstafollowers.com" android:scheme="http"
                    android:pathPrefix=".*"/>
            </intent-filter>
        </activity>

也试图与&LT;类机器人:名字=android.intent.category.BROWSABLE/&GT; 和没有的android:路径preFIX =*,但我的应用程序打开犯规

also tried with <category android:name="android.intent.category.BROWSABLE"/> and without android:pathPrefix=".*" but my app doesnt open.

推荐答案

解决我的问题,因为它原来普通的 HTTP HTTPS 不起作用。我要创建我的自定义方案为这个目的。

Solved my issue, as it turns out regular http, https doesn't work. I had to create my custom scheme for this purposes.

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

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