本文整理汇总了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...");
}
}
示例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);
}
}
}
示例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);
}
}
示例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();
}
示例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();
}
}
}
示例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...");
}
}
示例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));
}
}
示例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 ...");
}
}
示例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;
}
}
示例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();
}
示例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...");
}
}
示例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...");
}
}