Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
您好,我正在使用 Gson 解析器,在我的类中没有使用双变量,尽管我得到了 Invalid Double Exception,其中值作为 emtpty 字符串出现,但我的类结构中没有双变量。
谁能建议该怎么做?
似乎您正在尝试使用处理响应,Gson并且您的pojo 类模型具有数据类型Double,但响应返回值为“”,这是String默认值。
Gson
Double
String
请将同一字段的默认值设为 0,您的问题将得到解决。如果有后端人员为 API 工作,请他将这些字段的默认值设置为 0。