private void checkAutoLogin() { // 2013-02-20 자동로그인은 인트로에서 처리하도록 변경 // 더이상 자동으로 호출되지 않음 if (prefModel.isAutoLogin()) { // 씨네폭스 자동로그인은 여기로 안 넘어옴 if (EXTRA_AUTO_LOGIN_FACEBOOK.equals(prefModel.getAutoLoginAction())) { startActivityForResult( new Intent(this, FacebookLoginActivity.class), REQUEST_FACEBOOK_LOGIN); } else if (EXTRA_AUTO_LOGIN_ME2DAY.equals(prefModel.getAutoLoginAction())) { me2Model = new Me2DayModel(this); me2Model.setAuthCallback(this); me2Model.setUserInfoCallback(this); me2Model.loadMe2UserInfo(prefModel.getMe2LoginId()); } else if (EXTRA_AUTO_LOGIN_TWITTER.equals(prefModel.getAutoLoginAction())) { twModel = new TwitterModel(this); twModel.setAuthCallback(this); twModel.setUserInfoCallback(this); twModel.loadTwitUserInfo(prefModel.getTwitterAccessToken()); } else if (EXTRA_AUTO_LOGIN_YOZM.equals(prefModel.getAutoLoginAction())) { yozmModel = new YozmModel(this); yozmModel.setAuthCallback(this); yozmModel.setUserInfoCallback(this); yozmModel.loadYozmUserInfo(prefModel.getYozmAccessToken()); } } }
@Override public void onClickMe2dayLogin(SelectLoginMethodView view) { // TODO Auto-generated method stub me2Model = new Me2DayModel(this); me2Model.setAuthCallback(this); me2Model.setUserInfoCallback(this); String id = prefModel.getMe2LoginId(); if (id != null) me2Model.loadMe2UserInfo(id); else me2Model.loadMe2BaseInfo(); }
@Override public void onMe2AuthSuccess(Me2DayModel model, String authKey, String userId) { // TODO Auto-generated method stub view.dismissLoading(); prefModel.setMe2LoginKey(authKey); prefModel.setMe2LoginId(userId); // 자동로그인 설정 me2Model.setUserInfoCallback(this); me2Model.loadMe2UserInfo(userId); }
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { // TODO Auto-generated method stub super.onActivityResult(requestCode, resultCode, data); if (resultCode == Activity.RESULT_OK) { switch (requestCode) { case REQUEST_FACEBOOK_LOGIN: view.showLoading(); fbModel = new FacebookModel(this); fbModel.loadFBUserInfo(Session.getActiveSession(), this); break; case REQUEST_TWITTER_LOGIN: twModel.loadTwitAccessToken(data.getStringExtra(EXTRA_URL)); break; case REQUEST_ME2DAY_LOGIN: me2Model.loadMe2AuthInfo(); break; case REQUEST_YOZM_LOGIN: yozmModel.loadYozmAuthInfo(data.getStringExtra(EXTRA_URL)); break; case REQUEST_JOIN_ACTION: checkAutoLogin(); break; } } else if (resultCode == Activity.RESULT_CANCELED) { switch (requestCode) { case REQUEST_FACEBOOK_LOGIN: view.showError(data.getStringExtra(EXTRA_MSG)); break; case REQUEST_TWITTER_LOGIN: break; case REQUEST_ME2DAY_LOGIN: break; case REQUEST_YOZM_LOGIN: break; case REQUEST_JOIN_ACTION: break; } } }