response.getJSONArray("assets_data_source/templates")?.forEach { val template = (it as JSONObject) val templateBiz = template.getString("templateBiz") val templateId = template.getString("templateId") val templateBytes = getTemplateContents(activity, templateId) // callback result callback.template(templateBiz, templateId, templateBytes) }
正确的代码
response.getJSONArray("templates")?.forEach { val template = (it as JSONObject) val templateBiz = template.getString("templateBiz") val templateId = template.getString("templateId") val templateBytes = getTemplateContents(activity, templateId) // callback result callback.template(templateBiz, templateId, templateBytes) }
bug描述
RemoteDataSourceTemplateActivity中解析错误
错误代码
response.getJSONArray("assets_data_source/templates")?.forEach { val template = (it as JSONObject) val templateBiz = template.getString("templateBiz") val templateId = template.getString("templateId") val templateBytes = getTemplateContents(activity, templateId) // callback result callback.template(templateBiz, templateId, templateBytes) }
正确的代码
response.getJSONArray("templates")?.forEach { val template = (it as JSONObject) val templateBiz = template.getString("templateBiz") val templateId = template.getString("templateId") val templateBytes = getTemplateContents(activity, templateId) // callback result callback.template(templateBiz, templateId, templateBytes) }