Skip to content

Instantly share code, notes, and snippets.

@voldyman
Created December 11, 2012 07:24
Show Gist options
  • Save voldyman/4256564 to your computer and use it in GitHub Desktop.
Save voldyman/4256564 to your computer and use it in GitHub Desktop.
Snippet from CyClient
private void initLogin () {
Result res = loginMan.Login();
if (res.success) {
status = "LIVE";
mHandler.postDelayed(liveLoginTask, 1800L);
}
else {
//TODO send error to activity
mUsernameTxt.setText("Login");
}
}
private Handler mHandler;
Runnable liveLoginTask = new Runnable() {
@Override
public void run() {
Result res = loginMan.LiveLogin();
if (res.success && cont) {
status = "LIVE";
mHandler.postDelayed(this, 1800L);
}
else {
//TODO implement error sending to activity
status = "LOGIN";
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment