android webview加载网页获取对应url 参数值的方法

android webview加载网页获取对应url 参数值的方法,第1张

android webview加载网页获取对应url 参数值的方法
    private String getValueByName(String url, String name) {
        String result = "";
        int index = url.indexOf("?");
        String temp = url.substring(index + 1);
        String[] keyValue = temp.split("&");
        for (String str : keyValue) {
            if (str.contains(name)) {
                result = str.replace(name + "=", "");
                break;
            }
        }
        return result;
    }

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/5607568.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-12-15
下一篇2022-12-15

发表评论

登录后才能评论

评论列表(0条)

    保存