Verification login button Facebook on Android

0

Good evening, I'm new to programming, I'm starting now. My question is this, I started to study the Facebook Login API, she is logging in normally and forwarding to the next activity, so far so good. The problem is when I close the application and open again, it starts at the first activity with the "exit" button, the API itself, after leaving and logging in again it directs me to the next activity. How would I record the login, so when the application was restarted it would check if it is already logged in to the second activity? Thanks!

    
asked by anonymous 15.03.2016 / 04:25

1 answer

0

The "Exit" button indicates that you are already logged in, when you click Exit you end up logging in to the app and logging in again, what you need to do is check if the identifier is null or not, otherwise it means a user already exists. If you are already logged in, you are leaving SplashActivity for HomeAcitivy for example. If you are not logged in, you are signed out of SplashActivity for LoginActivity.

AccessToken.getCurrentAccessToken();

Do not forget to start facebook sdk.

    
15.03.2016 / 13:33