1
中未定义
我面临从Jsonarray(object)获取jsonarray的问题。错误在这一行 jsonArray = new JSONArray(value);错误 “的构造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;
}
我在我的android应用程序中集成Facebook SDK。而这条线阻止我在我的项目中继续前进。 – 2014-09-25 07:41:20
但有一个构造函数需要一个'Object':http://developer.android.com/reference/org/json/JSONArray.html#JSONArray(java.lang.Object)我希望运行时异常也许,但不是编译时错误。 – weston 2014-09-25 07:46:22
@weston,谢谢指出。我不知道那件事。它添加了最新的api(19),因此该操作正在编译一个旧的版本 – Blackbelt 2014-09-25 07:50:29