Last active
January 3, 2016 00:02
-
-
Save danylovolokh/b4e9e095ee99d399d2b6 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
/** | |
* 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