Android 在Chrome/Firefox上运行scheme时,应用程序未打开

Android 在Chrome/Firefox上运行scheme时,应用程序未打开,android,Android,我想使用scheme启动我的Android应用程序,这是我的代码: <activity android:name="com.myapp.SplashScreenActivity" android:alwaysRetainTaskState="true" android:label="@string/app_name" android:noHistory="true" > <intent-filter

我想使用scheme启动我的Android应用程序,这是我的代码:

<activity
        android:name="com.myapp.SplashScreenActivity"
        android:alwaysRetainTaskState="true"
        android:label="@string/app_name"
        android:noHistory="true" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        <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="www.myhost.com"
                android:pathPrefix="/company/"
                android:scheme="http" />
            <data
                android:host="myhost.com"
                android:pathPrefix="/company/"
                android:scheme="http" />
        </intent-filter>
    </activity>

然后在浏览器上运行:myhost.com/company/,结果如下:

  • 默认internet浏览器:应用程序正常打开
  • 铬:不起作用
  • 火狐:不工作
我不知道如何解决,请帮我解释一下。

你不应该使用“http”作为方案,因为Chrome和Firefox可以处理这种URL,他们不会调用其他应用程序来处理。相反,您可以使用自定义方案,如“myprotocol”,这些浏览器无法处理该方案,它们将调用您的应用程序来处理该方案。你可以跑“m”yprotocol://myhost.com/company/“在Chrome上测试它