gpt4 book ai didi

java - 我在将值从 JSON 对象赋值给局部变量时遇到问题,调试器显示变量 = 'this' 不可用

转载 作者:太空狗 更新时间:2023-10-29 12:59:32 25 4
gpt4 key购买 nike

The first time it is working fine , after some testing I got this problem.

i cant get value from Json Object , the Json Array is fine , but value not assinged.

我正在使用 Andorid StudioVolley 用于从 Json 格式 的网络服务器获取响应。

StringRequest postRequest = new StringRequest(StringRequest.Method.POST, syncURL,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
try{
long TempResponse = response.length();
if (TempResponse <= 2){
udo_Core.udfShowMessage("Error","Error In Getting Data From Server!",udo_temp_activity);
}else {
JSONArray arr = new JSONArray(response);
for (int i = 0; i < arr.length(); i++) {
JSONObject mJsonObject = arr.getJSONObject(i);
try{
udo_entry_max_BAR = mJsonObject.getLong("maxentryno");
udo_entry_min_BAR = mJsonObject.getLong("minentryno");
udo_entry_no_BAR = udo_entry_min_BAR;
udo_entry_no_MAX = udo_entry_max_BAR;
}catch (Exception e){
e.printStackTrace();
}

//udo_PRB_Limit = 100/(udo_entry_max_BAR-udo_entry_min_BAR);
}

}
}catch (JSONException e){
e.printStackTrace();
}
}
},
new Response.ErrorListener()
{ @Override
public void onErrorResponse(VolleyError error){
error.printStackTrace();
}
}
){
@Override
protected Map<String, String> getParams()
{
Map<String, String> params = new HashMap<String, String>();
params.put("query", udoQuery);
params.put("type", type);
params.put("companycode", "");
params.put("p_fm_loc", "");
params.put("p_to_loc", "");
params.put("p_fm_date", "");
params.put("p_to_date", "");
return params;
}
};
postRequest.setRetryPolicy(new DefaultRetryPolicy(12000,
DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
udoVolleyQuery.add(postRequest);

while Debugging , inside the loop assign value from Json Object to Local variable but In Debugger window shows " udo_entry_max_BAR = 'this' is not Available "

最佳答案

这仅在调试器窗口中显示,执行完成后您将获得值。

关于java - 我在将值从 JSON 对象赋值给局部变量时遇到问题,调试器显示变量 = 'this' 不可用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56712704/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com