解析json字符串时出现org.json.JSONException: End of input at character 0 of 异常
JSONObject jsonObject = new JSONObject(jsonString)
jsonObject.getString("key");
原因:jsonString为""空的字符串,或者为" "n个空格(此时异常信息为End of input at character n of)
解决
if (!TextUtils.isEmpty(jsonString)) {
JSONObject jsonObject = new JSONObject(jsonString);
jsonObject.getString("key");
}