Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Auth {
- public interface AuthOnCompleteListener {
- public void szöxessz();
- public void féjl();
- }
- ...
- private AuthOnCompleteListener listener;
- private NetworkManager nm;
- private static final String BASE_URL = "www.google.hu";
- private static final String LOGIN_URL = BASE_URL + "/login";
- ...
- public Auth(AuthOnCompleteListener listener){
- this.listener = listener;
- }
- ...
- public void login(String username, String pass){
- String shaPass = Encrypter.toSHA(pass);
- nm.get(LOGIN_URL+"?user="+username+"&password="+shaPass, new OnResponse(){
- public void onSuccess(){
- listener.szöxessz();
- }
- public void onFail(){
- listener.féjl()
- }
- })
- }
- ...
- }
- // másik file a controller
- public class LoginScreenController extends Activity implements AuthOnCompleteListener {
- ...
- private Auth auth;
- ...
- public void onCreate(){
- auth = new Auth(this);
- }
- ...
- public void szöxessz(){
- ...
- }
- ...
- public void féjl(){
- ...
- }
- ...
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement