android Uri.getQueryParameter 遇到的坑

711 阅读1分钟

scheme://?action=%7b%22type%22%3a%22web%22%2c%22param%22%3a%7b%22url%22%3a%22%2fpost_text.html%3ftype%3d%26info%3d%257b%2522id%2522%253a1%252c%2522key%2522%253a%2522d9d3a5b86c546206%2522%257d%22%7d%7d

Uri.getQueryParameter("action"),返回值为
{"type":"web","param":{"url":"/post_text.html?type=&info=%7b%22id%22%3a1%2c%22key%22%3a%22d9d3a5b86c546206%22%7d"}}
原因是 Uri.getQueryParameter 返回值是 decode 了的,无需再调用 Uri.decode()