1
Jsonarray (object)에서 jsonarray를 가져 오는 데 문제가 있습니다. 이 줄의 오류 jsonArray = 새 JSONArray (값); 오류가생성자 JSONArray (Object)가 android에서 정의되지 않았습니다.
public static JSONArray getPropertyJsonArray(GraphObject graphObject, String property) {
if (graphObject == null) {
return null;
}
Object value = graphObject.getProperty(property);
if (value == null || value.equals(EMPTY)) {
return null;
}
JSONArray jsonArray;
try {
//error line
jsonArray = new JSONArray(value);
return jsonArray;
} catch (JSONException e) {
try {
return (JSONArray) value;
} catch (Exception e1) {
}
}
return null;
}
내 안드로이드 응용 프로그램에 Facebook sdk를 통합하고 있습니다. 이 한 줄로 내 프로젝트를 계속 진행하게되었습니다. –
하지만'Object'를 사용하는 생성자가 있습니다 : http://developer.android.com/reference/org/json/JSONArray.html#JSONArray(java.lang.Object) 아마 런타임 예외가 예상됩니다. 컴파일 오류가 아닙니다. – weston
@ weston, 지적 해 주셔서 감사합니다. 나는 그것에 대해 몰랐다. 최신 api (19)가 추가되었으므로 op가 이전 verion과 비교하여 컴파일됩니다. – Blackbelt