Last active
August 29, 2015 14:18
-
-
Save cuber5566/dde493e084151e401747 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LoginActivity extends BaseActivity{ | |
... | |
// sign key error | |
else if (memberLoginResponse.getRc().equals(ResponseUtil.SIGN_KEY_ERROR) | |
||memberLoginResponse.getRc().equals(ResponseUtil.SIGN_KEY_ERROR_1) ){ | |
Message msgObj = uiHandler.obtainMessage(); | |
msgObj.what = MSG_SEND_MD5_HASH_KEY; | |
msgObj.arg1 = MSG_GET_MEMBER_LOGIN_RESPONSE; | |
uiHandler.sendMessage(msgObj); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BaseActivity extends ActionBarActivity implements Handler.Callback { | |
... | |
@Override | |
public boolean handleMessage(Message msg) { | |
switch (msg.what) { | |
case MSG_SEND_MD5_HASH_KEY: | |
msgWhat = msg.arg1; | |
NetWorkDataProvider.getInstance().getMD5HashKey(new Callback() { | |
@Override | |
public void onFailure(Request request, IOException e) { | |
hideProgressDialog(); | |
uiHandler.sendEmptyMessage(MSG_ERROR); | |
} | |
@Override | |
public void onResponse(Response response) throws IOException { | |
hideProgressDialog(); | |
String responseString = response.body().string(); | |
Log.e("NETWORK-getMD5HashKey", responseString); | |
getMD5HashkeyResponse = new Gson().fromJson(responseString, GetMD5HashKeyResponse.class); | |
uiHandler.sendEmptyMessage(MSG_GET_MD5_HASH_KEY); | |
} | |
}); | |
break; | |
case MSG_GET_MD5_HASH_KEY: | |
if (getMD5HashkeyResponse.getRc().equals(ResponseUtil.DONE)) { | |
NetWorkDataProvider.getInstance().sign_key = getMD5HashkeyResponse.getHashkey(); | |
localDataProvider.setSign_key(getMD5HashkeyResponse.getHashkey()); | |
localDataProvider.save(this); | |
uiHandler.sendEmptyMessage(msgWhat); | |
} else { | |
showHintDialog(getMD5HashkeyResponse.getRm()); | |
} | |
break; | |
case MSG_ERROR: | |
showHintDialog(getString(R.string.connect_error)); | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
rename