Android app not opening from URL using intent-filter

痞子三分冷 提交于 2020-02-06 08:30:46

问题


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>

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


回答1:


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



来源:https://stackoverflow.com/questions/28524730/android-app-not-opening-from-url-using-intent-filter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!