0
JSON 문자열 :안드로이드 구문 분석 JSON 파일
{conf:{"quantity_uom":"l",price_uom:"euro",distance_uom:"km",consumption_uom:"km/l"}}
코드 : 나는 No value for quantity_uom
을 돌아왔다
try{
if (str!=""){
this.json = new JSONObject(str);
this.quantityUom=this.json.getString("quantity_uom");
this.distanceUom=this.json.getString("distance_uom");
this.priceUom=this.json.getString("price_uom");
this.consumptionUom=this.json.getString("consumption_uom");
}
}catch (Exception e) {
throw e;
}
. 나는 어떻게 잘못하고 있니? String은 json 텍스트를 포함합니다.
정말 고마워요.
'str! = ""'Java/Android가 작동하지 않습니다. 이것을 사용하십시오 :'! str.equals ("")' – WarrenFaith
문자열이 유효한 JSON이 아닙니다. – JeremyP