我得到这个警告;如何删除它?
onResponce方法过于复杂,无法通过数据流算法进行分析
如何使这种方法更小巧有效? 我想尽快处理这些数据。
public void onResponse(String response) {
if (!response.equals("Error")) {
try {
JSONObject jsonObject = new JSONObject(response);
JSONArray jsonArray = jsonObject.getJSONArray("resultarray");
JSONObject jsonObject1 = jsonArray.getJSONObject(0);
String panno = jsonObject1.getString("panno");
String mobile = jsonObject1.getString("mobile");
String desg = jsonObject1.getString("desig");
String bdate = jsonObject1.getString("bdate");
String station = jsonObject1.getString("station");
String dept = jsonObject1.getString("dept");
String level = jsonObject1.getString("level");
String apdate = jsonObject1.getString("apdate");
String dsec = jsonObject1.getString("dsec");
String viipay = jsonObject1.getString("viipay");
String viilvl = jsonObject1.getString("viilvl");
String sec = jsonObject1.getString("sec");
String catg = jsonObject1.getString("catg");
String nxtinc = jsonObject1.getString("nxtinc");
if (panno.isEmpty()) panno = "N.A.";
if (mobile.isEmpty()) mobile = "N.A.";
if (desg.isEmpty()) desg = "N.A.";
if (bdate.equals("0000-00-00")) bdate = "N.A.";
if (station.isEmpty()) station = "N.A.";
if (dept.isEmpty()) dept = "N.A.";
if (level.isEmpty()) level = "N.A.";
if (apdate.equals("0000-00-00")) apdate = "N.A.";
if (dsec.equals("0000-00-00")) dsec = "N.A.";
if (viipay.equals("0")) viipay = "N.A.";
if (viilvl.equals("0")) viilvl = "N.A.";
if (sec.isEmpty()) sec = "N.A.";
if (catg.isEmpty()) catg = "N.A.";
if (nxtinc.equals(" - 0") || nxtinc.equals("0 - ") || nxtinc.equals("0 - 0") || nxtinc.equals(" - ")) nxtinc = "N.A.";
securePreferences.edit().putString("pfno", jsonObject1.getString("pfno")).apply();
securePreferences.edit().putString("name", jsonObject1.getString("name")).apply();
securePreferences.edit().putString("panno", panno).apply();
securePreferences.edit().putString("mobile", mobile).apply();
securePreferences.edit().putString("desg", desg).apply();
securePreferences.edit().putString("bdate", bdate).apply();
securePreferences.edit().putString("station", station).apply();
securePreferences.edit().putString("dept", dept).apply();
securePreferences.edit().putString("level", level).apply();
securePreferences.edit().putString("apdate", apdate).apply();
securePreferences.edit().putString("dsec", dsec).apply();
securePreferences.edit().putString("catg", catg).apply();
securePreferences.edit().putString("viipay", viipay).apply();
securePreferences.edit().putString("viilvl", viilvl).apply();
securePreferences.edit().putString("nxtinc", nxtinc).apply();
securePreferences.edit().putString("sec", sec).apply();
} catch (Exception e) {
e.printStackTrace();
}
}