Skip to content

Instantly share code, notes, and snippets.

@leiweibo
Last active January 27, 2016 08:24
Show Gist options
  • Save leiweibo/bc3ffa74b16deab80378 to your computer and use it in GitHub Desktop.
Save leiweibo/bc3ffa74b16deab80378 to your computer and use it in GitHub Desktop.
@Override public void doLogin(final Context context, final String userName, String password) {
UserInterface userNetworkService =
JApplication.getNetworkManager().getServiceByClass(UserInterface.class);
LoginRequest request = new LoginRequest();
request.username = userName;
request.password = password;
JApplication.getNetworkManager()
.async(context, Constant.LOGINING, userNetworkService.signin(request),
new NetworkCallback<SignupResponse>(context) {
@Override
public void onSuccess(SignupResponse signupResponse) {
((JFragmentActivity) context).dialogHelper.dismissProgressDialog();
sharedPreferenceHelper.saveLoginName(context, userName); //TODO 放到异步里面去做
doAfterSignin(context, signupResponse);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment