Skip to content Skip to sidebar Skip to footer

How To Store Login State Of Facebook In Android With Sdk 3.0

I have not push 'Log out' ,how to keep 'Log in' state ? anyway,I restart program etc. (I use Facebook sdk 3.0)

Solution 1:

Try this,

  1. You can get the accesstoken from the first valid session.

    Stringtoken=  session.getAccessToken()
    

    Then save this in sharepreferences.

  2. Then before you procceed with other functions, read the stored session is check weather the session is not null and is open.

    if(session.isOpened())
    {
     //proceed
    }
    

Post a Comment for "How To Store Login State Of Facebook In Android With Sdk 3.0"