更新时间:2023-01-15 23:41:05
您正在将StringBuilder
类的实例传递给JSONObject
构造函数.
You are passing into the JSONObject
constructor an instance of a StringBuilder
class.
这是使用JSONObject(Object)
构造函数,而不是JSONObject(String)
构造函数.
This is using the JSONObject(Object)
constructor, not the JSONObject(String)
one.
您的代码应为:
JSONObject jsonObj = new JSONObject(jsonString.toString());