Facebook Developers
DocsToolsSupportNewsApps
Log In
  • Social Plugins
  • Facebook Login
  • Open Graph
  • Facebook APIs
  • Games
  • Payments
  • App Center
  • Promote Your App
  • iOS
  • Android
    • Getting Started
    • Concepts
    • Reference
  • JavaScript
  • PHP
  • More SDKs
  • class
    • AccessToken
    • AccessTokenSource
    • AsyncFacebookRunner
    • CacheableRequestBatch
    • DialogError
    • Facebook
    • FacebookRequestError
    • FacebookRequestError.Category
    • FbDialog
    • FileLruCache
    • FileLruCache.Limits
    • FriendPickerFragment
    • GraphObject.Factory
    • HttpMethod
    • InsightsLogger
    • LegacyHelper
    • Logger
    • LoggingBehavior
    • LoginActivity
    • LoginButton
    • NonCachingTokenCachingStrategy
    • PickerFragment
    • PlacePickerFragment
    • ProfilePictureView
    • Request
    • RequestAsyncTask
    • RequestBatch
    • Response
    • Response.PagingDirection
    • Session
    • Session.AuthorizationRequest
    • Session.Builder
    • Session.NewPermissionsRequest
    • Session.OpenRequest
    • SessionDefaultAudience
    • SessionLoginBehavior
    • SessionState
    • Settings
    • SharedPreferencesTokenCachingStrategy
    • TestSession
    • TokenCachingStrategy
    • UiLifecycleHelper
    • UserSettingsFragment
    • Util
    • WebDialog
    • WebDialog.Builder
    • WebDialog.FeedDialogBuilder
    • WebDialog.RequestsDialogBuilder
  • exception
    • FacebookAuthorizationException
    • FacebookDialogException
    • FacebookError
    • FacebookException
    • FacebookGraphObjectException
    • FacebookOperationCanceledException
    • FacebookServiceException
  • interface
    • AsyncFacebookRunner.RequestListener
    • Facebook.DialogListener
    • Facebook.ServiceListener
    • GraphLocation
    • GraphMultiResult
    • GraphObject
    • GraphObjectList
    • GraphPlace
    • GraphUser
    • LoginButton.OnErrorListener
    • LoginButton.UserInfoChangedCallback
    • OpenGraphAction
    • PickerFragment.GraphObjectFilter
    • PickerFragment.OnDataChangedListener
    • PickerFragment.OnDoneButtonClickedListener
    • PickerFragment.OnErrorListener
    • PickerFragment.OnSelectionChangedListener
    • ProfilePictureView.OnErrorListener
    • PropertyName
    • Request.Callback
    • Request.GraphPlaceListCallback
    • Request.GraphUserCallback
    • Request.GraphUserListCallback
    • RequestBatch.Callback
    • Session.StatusCallback
    • WebDialog.OnCompleteListener

SessionState

SDK Reference › Android SDK › SessionState
package com.facebook
public final classSessionState extends Enum
Overview

Identifies the state of a Session.

Session objects implement a state machine that controls their lifecycle. This enum represents the states of the state machine.

Summary
Constants
SessionStateCREATED
Indicates that the Session has not yet been opened and has no cached token.
SessionStateCREATED_TOKEN_LOADED
Indicates that the Session has not yet been opened and has a cached token.
SessionStateOPENING
Indicates that the Session is in the process of opening.
SessionStateOPENED
Indicates that the Session is opened.
SessionStateOPENED_TOKEN_UPDATED
Indicates that the Session is opened and that the token has changed.
SessionStateCLOSED_LOGIN_FAILED
Indicates that the Session is closed, and that it was not closed normally.
SessionStateCLOSED
Indicates that the Session was closed normally.
Methods
static SessionStatevalues()
static SessionStatevalueOf(String name)
booleanisOpened()
Returns a boolean indicating whether the state represents a successfully opened state in which the Session can be used with a Request.
booleanisClosed()
Returns a boolean indicating whether the state represents a closed Session that can no longer be used with a Request.
Constants
public static final SessionState CREATED
Indicates that the Session has not yet been opened and has no cached token. Opening a Session in this state will involve user interaction.
public static final SessionState CREATED_TOKEN_LOADED

Indicates that the Session has not yet been opened and has a cached token. Opening a Session in this state will not involve user interaction.

If you are using Session from an Android Service, you must provide a TokenCachingStrategy implementation that contains a valid token to the Session constructor. The resulting Session will be created in this state, and you can then safely call open, passing null for the Activity.

public static final SessionState OPENING
Indicates that the Session is in the process of opening.
public static final SessionState OPENED
Indicates that the Session is opened. In this state, the Session may be used with a Request.
public static final SessionState OPENED_TOKEN_UPDATED

Indicates that the Session is opened and that the token has changed. In this state, the Session may be used with Request.

Every time the token is updated, StatusCallback is called with this value.

public static final SessionState CLOSED_LOGIN_FAILED
Indicates that the Session is closed, and that it was not closed normally. Typically this means that the open call failed, and the Exception parameter to StatusCallback will be non-null.
public static final SessionState CLOSED
Indicates that the Session was closed normally.
Methods
public static SessionState values()
public static SessionState valueOf(String name)
public boolean isOpened()
Returns a boolean indicating whether the state represents a successfully opened state in which the Session can be used with a Request.
Returns
a boolean indicating whether the state represents a successfully opened state in which the Session can be used with a Request.
public boolean isClosed()
Returns a boolean indicating whether the state represents a closed Session that can no longer be used with a Request.
Returns
a boolean indicating whether the state represents a closed Session that can no longer be used with a Request.

Last Updated: March 20, 2013

Facebook © 2013 · English (US)
AboutAdvertisingCareersPlatform PoliciesPrivacy Policy