| | |
| | | override fun onResponse(call: Call<ResponseBody>, response: Response<ResponseBody>) { |
| | | var str: String = response.body()!!.string() |
| | | MyLog.i(PlatFormConstant.HTTPTAG,str) |
| | | |
| | | jsonObject1 = JSONObject(str) |
| | | val result = jsonObject1!!.getBoolean("result") |
| | | if (result) { |
| | |
| | | |
| | | when(type){ |
| | | "road" ->{ |
| | | |
| | | mapInfoHead.type = BaseDataUIBean.TYPE_.road |
| | | val map = gson.fromJson<HttpRoadMapRsp>(str, HttpRoadMapRsp::class.java) |
| | | if (map.isResult) { |
| | |
| | | ExamPlatformData.getInstance().setNewRoadMapPath(Environment.getExternalStorageDirectory().absolutePath + "/" |
| | | + applicationContext.getPackageName() + "/" + fileName) |
| | | CThreadPoolExecutor.runInBackground(Runnable { |
| | | str = gson.toJson(map.data.map_json) |
| | | str = gson.toJson(map.data.map_json.map_json) |
| | | MyLog.i(PlatFormConstant.HTTPTAG,"科三道路地图保存成功") |
| | | FileUtil.writeTxtFileToSD(applicationContext, fileName, str, "") |
| | | // sendRoadMapInfo() |
| | | sendRoadMapInfo() |
| | | }) |
| | | } |
| | | |