public void updateDiscoveryResult(Boolean result) { disRes.setText(result ? "发现1台魔豆路由器" : "发现0台魔豆路由器"); gateway.setText(result ? CommonUtil.getGateway(context) : ""); loginUsername.setText(result ? "matrix" : ""); if (!result) { CommonUtil.showToast(context, "没有连接wifi或者没有连接魔豆路由器"); } }
private boolean submitCheck() { if (TextUtils.isEmpty(gateway.getText())) { CommonUtil.showToast(context, "网关地址不可为空"); return false; } if (TextUtils.isEmpty(loginUsername.getText())) { CommonUtil.showToast(context, "管理用户名不可为空"); return false; } if (TextUtils.isEmpty(loginPass.getText())) { CommonUtil.showToast(context, "管理密码不可为空"); return false; } return true; }