当前位置: 首页>>代码示例>>Java>>正文


Java SessionState.isClosed方法代码示例

本文整理汇总了Java中com.facebook.SessionState.isClosed方法的典型用法代码示例。如果您正苦于以下问题:Java SessionState.isClosed方法的具体用法?Java SessionState.isClosed怎么用?Java SessionState.isClosed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.facebook.SessionState的用法示例。


在下文中一共展示了SessionState.isClosed方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onSessionStateChange

import com.facebook.SessionState; //导入方法依赖的package包/类
private void onSessionStateChange(Session session, SessionState state, Exception exception) {
	Log.i("SplashscreenActivity", "onSessionStateChange");
	Controller.getInstance().setSession(session);
	if(state.isOpened() && !mConnected){
		mConnected = true;
		session.refreshPermissions();
		List<String> permissions = session.getPermissions();
		Log.i("FACEBOOK_CONNECTION", "Logged in..." + permissions.toString());
		findViewById(R.id.authButton).setVisibility(View.GONE);
		findViewById(R.id.progressBar).setVisibility(View.VISIBLE);
		((ProgressWheel) findViewById(R.id.progressBar)).spin();
		Server.connect(session.getAccessToken());
	} else if(state.isClosed()) {
		mConnected = false;
		Log.i("FACEBOOK_CONNECTION", "Logged out...");
	}
}
 
开发者ID:theblindr,项目名称:blindr,代码行数:18,代码来源:SplashscreenActivity.java

示例2: onSessionStateChange

import com.facebook.SessionState; //导入方法依赖的package包/类
private void onSessionStateChange(Session session, SessionState state, Exception exception)
{
	if (getView() != null)
	{
		if (state.isOpened())
		{
			authButton.setVisibility(View.GONE);
			progressBar.setVisibility(View.VISIBLE);
		}
		else if (state.isClosed())
		{
			authButton.setVisibility(View.VISIBLE);
			progressBar.setVisibility(View.GONE);
		}
	}
}
 
开发者ID:jonathangerbaud,项目名称:KlyphMessenger,代码行数:17,代码来源:LoginFragment.java

示例3: call

import com.facebook.SessionState; //导入方法依赖的package包/类
@Override
public void call(Session session, SessionState state, Exception exception) {
    if (wrapped != null && isTracking()) {
        wrapped.call(session, state, exception);
    }
    // if we're not tracking the Active Session, and the current session
    // is closed, then start tracking the Active Session.
    if (session == SessionTracker.this.session && state.isClosed()) {
        setSession(null);
    }
}
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:12,代码来源:SessionTracker.java

示例4: onSessionStateChange

import com.facebook.SessionState; //导入方法依赖的package包/类
/** Re authenticate after session state changed.*/
public static Promise<Object, BError, Void> onSessionStateChange(Session session, SessionState state, Exception exception) {
    if (DEBUG) Timber.i("Session changed state");

    // If we can start the login process with no errors this promise wont be used. 
    // The returned promise will be from the loginWithFacebook.
    Deferred<Object, BError, Void> deferred = new DeferredObject<>();
    
    if (exception != null)
    {
        exception.printStackTrace();
        if (exception instanceof FacebookOperationCanceledException)
        {
            deferred.reject(new BError(BError.Code.EXCEPTION, exception));
            return deferred.promise();
        }
    }

    if (state.isOpened()) {
        if (DEBUG) Timber.i("Session is open.");

        // We will need this session later to make request.
        userFacebookAccessToken = Session.getActiveSession().getAccessToken();

        return loginWithFacebook();

    } else if (state.isClosed()) {
        // Logged out of Facebook
        if (DEBUG) Timber.i("Session is closed.");
        deferred.reject(new BError(BError.Code.SESSION_CLOSED, "Facebook session is closed."));
    }
    
    
    return deferred.promise();
}
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:36,代码来源:BFacebookManager.java

示例5: onSessionStateChange

import com.facebook.SessionState; //导入方法依赖的package包/类
public void onSessionStateChange(Session session, SessionState state, Exception exception) {
    if (state.isOpened()) {
        requestUserData(session);
    } else if (state.isClosed()) {
        mUserHelper.setCurrentUser(null);
        if ( mUserSessionCallback != null ) {
            mUserSessionCallback.onLogout();
        }
    }
}
 
开发者ID:alessandrogurgel,项目名称:pedefacil,代码行数:11,代码来源:FbLoginDelegate.java

示例6: onSessionStateChange

import com.facebook.SessionState; //导入方法依赖的package包/类
private void onSessionStateChange(Session session, SessionState state, Exception exception) {
    if (state.isOpened()) {
        Log.i(TAG, "Logged in...");
    } else if (state.isClosed()) {
        Log.i(TAG, "Logged out...");
    }
}
 
开发者ID:jacquesgiraudel,项目名称:TP-Formation-Android,代码行数:8,代码来源:TestFacebookActivity.java

示例7: onSessionStateChange

import com.facebook.SessionState; //导入方法依赖的package包/类
private void onSessionStateChange(Session session, SessionState state, Exception exception) {
	if (state.isOpened()) {
		Log.i(TAG, getString(R.string.fb_logged_in));
	} else if (state.isClosed()) {
		Log.i(TAG, getString(R.string.fb_logged_out));
	}
}
 
开发者ID:scintero,项目名称:moveon,代码行数:8,代码来源:History.java

示例8: onSessionStateChange

import com.facebook.SessionState; //导入方法依赖的package包/类
private void onSessionStateChange(Session session, SessionState state,
        Exception exception) {
    if (state.isOpened()) {
        if (callback != null) {
            callback.onLogin(session.getAccessToken());
        }
        logger.debug("Facebook Logged in...");
    } else if (state.isClosed()) {
        logger.debug("Facebook Logged out...");
    } else {
        logger.debug("Facebook state changed ...");
    }
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:14,代码来源:FacebookAuth.java

示例9: onSessionStateChange

import com.facebook.SessionState; //导入方法依赖的package包/类
private void onSessionStateChange(Session session, SessionState state, Exception exception)
{
    if(exception != null)
    {
        // Handle exception here.
        Log.v("Facebook CALLBACK", "Facebook login error " + exception);
        return;
    }
    if (state != null && state.isOpened()) {

        if (session.isPermissionGranted(PERMISSION))
        {
            if (mPendingAction)
            {
                // Session ready to make requests.
                postImageToFacebook();
                mPendingAction = false;
            }
        }
        else
        {
            // Get the permissions if we don't have them.
            session.requestNewPublishPermissions(new Session.NewPermissionsRequest(this, PERMISSION));
        }
    }
    else if (state.isClosed())
    {
        // Session logged out.
        return;
    }
}
 
开发者ID:b099l3,项目名称:FacebookImageShareIntent,代码行数:32,代码来源:FacebookShareActivity.java

示例10: onSessionStateChange

import com.facebook.SessionState; //导入方法依赖的package包/类
private void onSessionStateChange(Session paramSession, SessionState paramSessionState, Exception paramException)
{
  if (!paramSessionState.isOpened())
    paramSessionState.isClosed();
  if (((paramSessionState == SessionState.CLOSED_LOGIN_FAILED) || (paramSessionState == SessionState.CLOSED)) && (!this.mIsWaitingForPlusClient))
    hideLoadingLayer();
  if (paramException != null)
    paramException.printStackTrace();
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:10,代码来源:LoginActivity.java

示例11: onSessionStateChange

import com.facebook.SessionState; //导入方法依赖的package包/类
private void onSessionStateChange(Session session, SessionState state, Exception exception) {
    if (state.isOpened()) {
        Log.i(TAG, "Logged in...");
        
        ApplicationData.getInstance().setSession(session);
        
        Intent intent = new Intent(this, FriendsActivity.class);
        startActivity(intent);
    } 
    else if (state.isClosed()) {
        Log.i(TAG, "Logged out...");
    }
}
 
开发者ID:josenaves,项目名称:facebook-friends,代码行数:14,代码来源:LoginActivity.java

示例12: onSessionStateChange

import com.facebook.SessionState; //导入方法依赖的package包/类
private void onSessionStateChange(Session session, SessionState state,
		Exception exception) {
	session = Session.getActiveSession();
	if (session.isOpened()) {
		/*
		CacheData.getInstant().setUrlFaceBook(URL_PREFIX+session.getAccessToken());
		Log.i("Urltessttttttttt",URL_PREFIX+session.getAccessToken());
		AuthenticationManager manager = new AuthenticationManager();
		manager.getUserInfoFaceBook(new AuthenticationManager.OnPaserInfoFaceBookResult() {
			
			@Override
			public void onPaserInfoFaceBookResult(boolean isSuccess,
					final CacheUser cacheUser, String message) {
				if(isSuccess){
					String urlAvatar = "http://graph.facebook.com/"+cacheUser.getId()+"/picture";
					Utils.loadBitmap(urlAvatar, new Utils.OnBitmapResult() {
						
						@Override
						public void onBitmapResult(boolean isSuccess, String message, Bitmap bitmap) {
							if(isSuccess){
								if(bitmap != null){
									cacheUser.setAvatar(bitmap);
									Log.i("Testbitmap","Bitmap khong null");
								}
							}
						}
					});
					CacheData.getInstant().setCacheUser(cacheUser);
					Log.i("Test du lieu",CacheData.getInstant().getCacheUser().getEmail() + CacheData.getInstant().getCacheUser().getAvatar());
					Intent intent = new Intent(getActivity(),TaskActivity.class);
					startActivity(intent);
				}
			}
		});
		*/
		
		Request request = Request.newMeRequest(session,new Request.GraphUserCallback() {
			
			@Override
			public void onCompleted(GraphUser user, Response response) {
				if( user != null){
					Log.i("Email",(String)user.getProperty("email"));
					Log.i("Email",user.getId());
					Log.i("Email",user.getBirthday());
					Log.i("Email",user.getFirstName());
					Log.i("Email",user.getLastName());
					Log.i("Email",user.getUsername());
				}
				
			}
		});
		Request.executeBatchAsync(request);
	} else if (state.isClosed()) {
		Log.i(TAG, "Logged out...");
	}
}
 
开发者ID:thoinv,项目名称:kaorisan,代码行数:57,代码来源:LoginFragment.java


注:本文中的com.facebook.SessionState.isClosed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。