为什么 android 不处理路径中有 # 的深层链接 url

Why android does not handle a deeplink url which has # in the path

url http://javaexample.com/#/topics 是否有效 url?

我正在尝试在应用程序中深度链接上述 url 使用:

  <intent-filter android:label="@string/app_name">
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="http"
                android:host="javaexample.com"
                android:pathPrefix="/#/topics" />
        </intent-filter> 

但是终端抛出消息 -

Activity 未启动,无法解析 Intent { act=android.intent.action.VIEW dat=http://javaexample.com/...

是 url http://javaexample.com/#/topics 不是有效的 url 如果路径中有 #?

URL中的#表示fragment component的开始,不能用于深层link条件。即使您已将片段结构化为 看起来 像人眼的正常 URL 路径,但计算机不会以这种方式读取它。

您需要重新格式化 URL 以在路径前不包含任何 # 字符。