Skip to content

Instantly share code, notes, and snippets.

@danylovolokh
Last active January 3, 2016 00:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danylovolokh/b4e9e095ee99d399d2b6 to your computer and use it in GitHub Desktop.
Save danylovolokh/b4e9e095ee99d399d2b6 to your computer and use it in GitHub Desktop.
/**
* This activity was created only in test purposes.
* Is can accept a callback by {@link #setLoginCallback(LoginTestCallback)}
* The {@link LoginTestCallback#onHandleResponseCalled(LoginResponse)} will be called when login response arrives.
*
* Using this approach the calling side can validate that login response received.
*/
public class LoginTestActivity extends LoginActivity {
private LoginTestCallback mCallback;
public void setLoginCallback(LoginTestCallback loginCallback){
mCallback = loginCallback;
}
public interface LoginTestCallback{
void onHandleResponseCalled(LoginResponse loginResponse);
}
@Override
public void handleLoginResponse(LoginResponse loginResponse) {
mCallback.onHandleResponseCalled(loginResponse);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment