深层链接路径被削减为2个段

时间:2016-04-27 14:31:23

标签: android uri deep-linking

在我的应用中实现了深层链接,但无法理解Uri.getPath()方法是如何工作的......看起来它会切断2段的路径,但为什么呢?

enter image description here

为什么?我无法看到任何其他可以让我回到原点的方法。

2 个答案:

答案 0 :(得分:1)

以下是解释:(来自wikipedia

                    hierarchical part
        ┌───────────────────┴─────────────────────┐
                    authority               path
        ┌───────────────┴───────────────┐┌───┴────┐
  abc://username:password@example.com:123/path/data?key=value#fragid1
  └┬┘   └───────┬───────┘ └────┬────┘ └┬┘           └───┬───┘ └──┬──┘
scheme  user information     host     port            query   fragment

答案 1 :(得分:1)

据此 http://developer.android.com/reference/android/net/Uri.html#getPath() 它解码你的道路。阅读完整的文档,以便更好地了解Uri