Android 6 - 无法从Chrome打开应用网址

时间:2016-01-21 11:05:57

标签: android google-chrome android-manifest android-6.0-marshmallow

我在manifest.xml中有设置意图过滤器,如下所示:

    <activity
            android:name="indexgifto.android.ui.viewcontrollers.SplashScreenActivity"
            android:label="@string/application_name"
            android:launchMode="singleTop"
            android:windowSoftInputMode="adjustNothing"
            android:theme="@android:style/Theme.Translucent.NoTitleBar"
            android:screenOrientation="portrait" >
        <intent-filter>
            <data android:scheme="gifto"/>
            <data android:scheme="http" />
            <data android:host="www.gifto.net"/>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

当我执行'am start http://www.gifto.net/go.php?c=xlh201时,应用程序成功打开并显示所需数据。但是,当通过Chrome打开同一个网址时,只会打开服务器页面。在android 4中,在这两种情况下我的应用程序都可以从这个URL开始。我必须在android 6中修复什么?

2 个答案:

答案 0 :(得分:0)

这对我有用,如果为你工作,你可以尝试一次。

    <intent-filter>
      <action android:name="android.intent.action.VIEW"></action>
      <category android:name="android.intent.category.DEFAULT"></category>
      <category android:name="android.intent.category.BROWSABLE"></category>
      <data android:host="www.youtube.com" android:scheme="http" android:pathPrefix="http"></data>
    </intent-filter>

答案 1 :(得分:0)

适用于Android的Chrome版本25及更高版本,您应该实现用户手势以通过自定义方案启动应用,或使用本文中介绍的“intent:”语法。

https://developer.chrome.com/multidevice/android/intents

相关问题