diff options
Diffstat (limited to 'client/Piztor/src/com/macaroon/piztor/Login.java')
-rw-r--r-- | client/Piztor/src/com/macaroon/piztor/Login.java | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/client/Piztor/src/com/macaroon/piztor/Login.java b/client/Piztor/src/com/macaroon/piztor/Login.java index 533eeac..bdbf7ed 100644 --- a/client/Piztor/src/com/macaroon/piztor/Login.java +++ b/client/Piztor/src/com/macaroon/piztor/Login.java @@ -16,10 +16,7 @@ public class Login extends PiztorAct { Button btnLogin; EditText edtUser, edtPass; - int loginButtonClick = 1, retryButtonClick = 2, loginFailed = 3; - - @SuppressLint("HandlerLeak") Handler handler = new Handler() { @Override public void handleMessage(Message m) { @@ -32,13 +29,14 @@ public class Login extends PiztorAct { if (m.what == 0) { ResLogin res = (ResLogin) m.obj; Log.d(LogInfo.login, LogInfo.s); - Infomation.token = res.t; - Infomation.sublist = res.sublist; - Infomation.username = res.uinfo.username; - Infomation.myInfo = new UserInfo(res.uinfo.uid); - Infomation.myInfo.setInfo(res.uinfo.gid.company, + app.token = res.t; + app.sublist = res.sublist; + app.username = res.uinfo.username; + app.mapInfo.myInfo = new UserInfo(res.uinfo.uid); + app.mapInfo.myInfo.setInfo(res.uinfo.gid.company, res.uinfo.gid.section, res.uinfo.sex, res.uinfo.nickname); + app.mapInfo.myInfo.level = res.uinfo.level; System.out.println("login !!!!" + res.sublist.size()); actMgr.trigger(AppMgr.loginSuccess); } else { @@ -67,7 +65,7 @@ public class Login extends PiztorAct { String pass = edtPass.getText().toString(); long nowtime = System.currentTimeMillis(); System.out.println(user + " : " + pass + "\n"); - AppMgr.transam.send(new ReqLogin(user, pass, nowtime, 5000)); + transam.send(new ReqLogin(user, pass, nowtime, 5000)); } @Override @@ -90,7 +88,7 @@ public class Login extends PiztorAct { ActStatus[] r = new ActStatus[2]; r[0] = new StartStatus(); r[1] = new LoginStatus(); - actMgr = new ActMgr(this, r[0], r); + actMgr = new ActMgr(appMgr, this, r[0], r); actMgr.add(r[0], loginButtonClick, r[1]); actMgr.add(r[1], loginFailed, r[0]); setContentView(R.layout.activity_login); @@ -113,16 +111,13 @@ public class Login extends PiztorAct { @Override protected void onResume() { super.onResume(); - if (AppMgr.transam == null) - Log.d(LogInfo.exception, "transam = null"); - AppMgr.transam.setHandler(handler); - + transam.setHandler(handler); } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { - AppMgr.exit(); + appMgr.exit(); return true; } return super.onKeyDown(keyCode, event); |