1

DataRequestURL一起传递时出现错误– 生成了另外 3 个字符串 – 0x22cd051c NORMAL null ----- 十六进制、正常和 null 我明白为什么将它们附加到 URL ?

数据请求.java

public DataRequest(int method, String url, Map<String, String> params,
            Listener<JSONObject> reponseListener, ErrorListener errorListener) {
        super(method, url, errorListener);

        Log.i("url", url);

        this.listener = reponseListener;
        this.params = params;
        this.errorListener = errorListener;
    }
MainActivity

    public void updateList(String place) {
        String input = "";

        try {
            input = "input=" + URLEncoder.encode(place, "utf-8");
        } catch (UnsupportedEncodingException e1) {
            e1.printStackTrace();
        }

        String output = "json";
        String parameter = input + "&types=geocode&sensor=true&key="
                + browserKey;

        url = "https://maps.googleapis.com/maps/api/place/autocomplete/"
                + output + "?" + parameter;
        Log.d("url", url);

        DataRequest dataRequest = new DataRequest(Method.GET, url, null, this, this);
         Log.d("datarequest:",dataRequest.toString());
        RouteViaApp.getInstance().addToReqQueue(dataRequest, "jreq");
    }
4

0 回答 0