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


Java Session.isClosed方法代码示例

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


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

示例1: fetchProfileInfoFromFacebook

import com.facebook.Session; //导入方法依赖的package包/类
/**
 * Fetch profile information from Facebook
 */
private void fetchProfileInfoFromFacebook() {

    mWasProfileImageUploaded = false;
    final Session session = Session.getActiveSession();
    if (!session.isOpened() && !session.isClosed()) {
        session.openForRead(new Session.OpenRequest(this)
                .setPermissions(Arrays
                        .asList(AppConstants
                                .FBPERMISSIONS))
                .setCallback(this));
    } else {
        Session.openActiveSession(getActivity(), this, true, this);

    }
}
 
开发者ID:yeloapp,项目名称:yelo-android,代码行数:19,代码来源:EditProfileFragment.java

示例2: connect

import com.facebook.Session; //导入方法依赖的package包/类
@Override
public void connect(Activity activity)
{
	Session session = Session.getActiveSession();

	// TODO: I think we should validate the session here, but to what
	// extent?

	MadFacebookStatusCallback statusCallback =
			new MadFacebookStatusCallback();

	// Check if the session is already open.
	if (!session.isOpened() && !session.isClosed())
	{
		OpenRequest openRequest = new OpenRequest(activity);
		session.openForRead(openRequest
				.setCallback(statusCallback));
	}
	else
	{
		Session.openActiveSession(activity, true,
				statusCallback);
	}

}
 
开发者ID:netanelkl,项目名称:guitar_guy,代码行数:26,代码来源:FacebookProfileConnector.java

示例3: onSessionStateChange

import com.facebook.Session; //导入方法依赖的package包/类
@Override
protected void onSessionStateChange(Session session, SessionState state, Exception exception){
    final TextView txtUserDetails = (TextView) mCurrentView.findViewById(R.id.mapViewLoggedInUser);
    if (session != null && session.isOpened()) {
        Request request = Request.newMeRequest(session, new Request.GraphUserCallback() {
            @Override
            public void onCompleted(GraphUser user,
                                    Response response) {
                if (user != null) {
                    txtUserDetails.setText("Logged in as " + user.getName());
                    System.out.println("onSessionStateChange: LoadNotes: session is open. username:"+user.getName());
                }
            }
        });
        Request.executeBatchAsync(request);
    } else if (session.isClosed()) {
        txtUserDetails.setText("");
        System.out.println("onSessionStateChange: LoadNotes: session was closed.");
    }
}
 
开发者ID:ZanyGnu,项目名称:GeoNote,代码行数:21,代码来源:MapViewFragment.java

示例4: onSessionStateChangeP

import com.facebook.Session; //导入方法依赖的package包/类
private void onSessionStateChangeP(Session session, SessionState state, Exception exception)
{
    if (session != null && session.isOpened()) {
        Request request = Request.newMeRequest(session, new Request.GraphUserCallback() {
            @Override
            public void onCompleted(GraphUser user,
                                    Response response) {
                if (user != null) {
                    LoggedInUser = user;
                }
            }
        });
        Request.executeBatchAsync(request);
    } else if (session.isClosed()) {
        LoggedInUser = null;
    }

    onSessionStateChange(session, state, exception);
}
 
开发者ID:ZanyGnu,项目名称:GeoNote,代码行数:20,代码来源:BaseFacebookHandlerFragment.java

示例5: populateLoggedInUser

import com.facebook.Session; //导入方法依赖的package包/类
private void populateLoggedInUser() {

            final TextView txtUserDetails = (TextView) this.getActivity().findViewById(R.id.userDetails);

            final Session session = Session.getActiveSession();
            if (session != null && session.isOpened()) {
                // If the session is open, make an API call to get user data
                // and define a new callback to handle the response
                Request request = Request.newMeRequest(session, new Request.GraphUserCallback() {
                    @Override
                    public void onCompleted(GraphUser user, Response response) {
                        // If the response is successful
                        if (session == Session.getActiveSession()) {
                            if (user != null) {
                                String user_ID = user.getId();//user id
                                String profileName = user.getName();//user's profile name
                                txtUserDetails.setText(user.getName());
                            }
                        }
                    }
                });
                Request.executeBatchAsync(request);
            } else if (session == null || session.isClosed()) {

            }
        }
 
开发者ID:ZanyGnu,项目名称:GeoNote,代码行数:27,代码来源:LoginActivityFB.java

示例6: onResume

import com.facebook.Session; //导入方法依赖的package包/类
public void onResume() {
    Session session = Session.getActiveSession();
    if (session != null &&
            (session.isOpened() || session.isClosed()) ) {
        onSessionStateChange(session, session.getState(), null);
    }
    mUiHelper.onResume();
}
 
开发者ID:alessandrogurgel,项目名称:pedefacil,代码行数:9,代码来源:FbLoginDelegate.java

示例7: onClickLogin

import com.facebook.Session; //导入方法依赖的package包/类
public void onClickLogin() {
    Session session = Session.getActiveSession();
    if (!session.isOpened() && !session.isClosed()) {
        Session.OpenRequest openRequest = new Session.OpenRequest(mContext);
        openRequest.setPermissions(this.mPermissions);
        openRequest.setCallback(this);
        session.openForRead(openRequest);
    } else {
        Session.openActiveSession(mContext, true, this);
    }
}
 
开发者ID:alessandrogurgel,项目名称:pedefacil,代码行数:12,代码来源:FbLoginDelegate.java

示例8: onResume

import com.facebook.Session; //导入方法依赖的package包/类
@Override
protected void onResume() {
    super.onResume();

    Session session = Session.getActiveSession();
    if (session != null && (session.isClosed() || session.isOpened())) {
        onSessionChange(session, session.getState(), null);
    }

    uiHelper.onResume();
}
 
开发者ID:dannegm,项目名称:BrillaMXAndroid,代码行数:12,代码来源:Logout.java

示例9: onResume

import com.facebook.Session; //导入方法依赖的package包/类
@Override
protected void onResume() {
	super.onResume();
	Log.i("SplashscreenActivity", "onResume");
	Session session = Session.getActiveSession();
	if (session != null &&
			(session.isOpened() || session.isClosed()) ) {
		onSessionStateChange(session, session.getState(), null);
	}
	uiHelper.onResume();

}
 
开发者ID:theblindr,项目名称:blindr,代码行数:13,代码来源:SplashscreenActivity.java

示例10: onResume

import com.facebook.Session; //导入方法依赖的package包/类
@Override
public void onResume() {
    super.onResume();

    // For scenarios where the main activity is launched and user
    // session is not null, the session state change notification
    // may not be triggered. Trigger it if it's open/closed.
    Session session = Session.getActiveSession();
    if (session != null &&
            (session.isOpened() || session.isClosed()) ) {
        onSessionStateChange(session, session.getState(), null);
    }

    uiHelper.onResume();
}
 
开发者ID:jacquesgiraudel,项目名称:TP-Formation-Android,代码行数:16,代码来源:TestFacebookActivity.java

示例11: onClickLogin

import com.facebook.Session; //导入方法依赖的package包/类
private void onClickLogin() {
	Session session = Session.getActiveSession();
	if (!session.isOpened() && !session.isClosed()) {
		session.openForRead(new Session.OpenRequest(this).setPermissions(
				Arrays.asList("email","user_birthday")).setCallback(this));
	} else {
		Session.openActiveSession(this, true, this);
	}
}
 
开发者ID:ohmp,项目名称:UniversalSocialLoginAndroid,代码行数:10,代码来源:FacebookLoginActivity.java

示例12: login

import com.facebook.Session; //导入方法依赖的package包/类
@Override
public void login() {
    Session session = Session.getActiveSession();
    if ( activity == null )
        return;
    if (session != null && !session.isOpened() && !session.isClosed()) {
        session.openForRead(new Session.OpenRequest(activity)
                .setPermissions(Arrays.asList("public_profile", "email"))
                .setCallback(statusCallback));
    } else {
        Session.openActiveSession(activity, true, Arrays.asList("public_profile", "email"), statusCallback);
    }
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:14,代码来源:FacebookAuth.java

示例13: onActivityResumed

import com.facebook.Session; //导入方法依赖的package包/类
@Override
public void onActivityResumed(Activity activity) {
    super.onActivityResumed(activity);
    // For scenarios where the main activity is launched and user
    // session is not null, the session state change notification
    // may not be triggered. Trigger it if it's open/closed.
    Session session = Session.getActiveSession();
    if (session != null && (session.isOpened() || session.isClosed())) {
        onSessionStateChange(session, session.getState(), null);
    }

    uiHelper.onResume();
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:14,代码来源:FacebookAuth.java

示例14: onResume

import com.facebook.Session; //导入方法依赖的package包/类
@Override
public void onResume() {
    super.onResume();
    Session session = Session.getActiveSession();
    if (session != null &&
            (session.isOpened() || session.isClosed()) ) {
        onSessionStateChangeP(session, session.getState(), null);
    }

    uiHelper.onResume();
}
 
开发者ID:ZanyGnu,项目名称:GeoNote,代码行数:12,代码来源:BaseFacebookHandlerFragment.java

示例15: onClickLogout

import com.facebook.Session; //导入方法依赖的package包/类
private void onClickLogout() {
	Session session = Session.getActiveSession();
	if (!session.isClosed()) {
		session.closeAndClearTokenInformation();
	}
}
 
开发者ID:ohmp,项目名称:UniversalSocialLoginAndroid,代码行数:7,代码来源:FacebookLoginActivity.java


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