如何在翻新中处理动态JSON?
我正在使用改造高效的网络库,但是无法处理包含单个前缀的Dynamic JSON,该前缀 responseMessage会object随机responseMessage更改,在某些情况下(动态),相同的前缀()会更改为String。 Json格式的responseMessage对象: { "applicationType":"1", "responseMessage":{ "surname":"Jhon", "forename":" taylor", "dob":"17081990", "refNo":"3394909238490F", "result":"Received" } } responseMessage Json格式会动态更改为字符串类型: { "applicationType":"4", "responseMessage":"Success" } 我的问题是,因为改造具有内置的JSON解析功能,所以我必须为每个请求分配单个POJO!但不幸的是,REST-API是基于动态JSON响应构建的。前缀将在成功(...)和失败(...)方法中从字符串随机更改为对象! void doTrackRef(Map<String, String> paramsref2) { RestAdapter restAdapter = new RestAdapter.Builder().setEndpoint("http://192.168.100.44/RestDemo").build(); TrackerRefRequest userref = restAdapter.create(TrackerRefRequest.class); userref.login(paramsref2, new Callback<TrackerRefResponse>() { @Override public void success( TrackerRefResponse trackdetailresponse, Response response) { Toast.makeText(TrackerActivity.this, …