/** * 赋值给当前期 * * @param type彩种编号 */ public void setIssue(String type) { // 获取期号和截止时间 JSONObject ssqLotnoInfo = PublicMethod.getCurrentLotnoBatchCode(type); if (ssqLotnoInfo != null && ssqLotnoInfo.has(type)) { // 成功获取到了期号信息 try { String issueStr = ssqLotnoInfo.getString("batchCode"); String timeStr = ssqLotnoInfo.getString("endTime"); issue.setText("第" + issueStr + "期"); time.setText("截止时间:" + timeStr); } catch (JSONException e) { e.printStackTrace(); } } else { // 没有获取到期号信息,重新联网获取期号 PublicMethod.getIssue(type, issue, time, new Handler()); } }