Question

I am a bit confused with facebook login procedure.

At the moment my application works like this:

  1. Login activity where user logs in and starts fragment activity
  2. Fragment activity with viewpager and 3 fragments

This works, but there is a problem, everytime user starts an app Login activity is called. How can i bypass this if session is active or even better how can i implement this in my Fragment activity.

For example if there is no user logged in, login window/fragment shows and then is redirected back to viewpager and default 3 fragments.

I was following this tutorial

https://developers.facebook.com/docs/android/login-with-facebook

Problem with this tutorial is that it opens Main Fragment and thats it, there is no "redirecting" and i am not sure how to come back to my viewpager.

Was it helpful?

Solution

Assuming you are familiar with android and java properly use an asynctask to get the logged in facebook user using a session than you can make a decider thread in case the session.isOpen() boolean value is true go to some activity and in case it's false go to your login activity - this thread also have a similar question to yours
plus you can find some more info on sessions over here

OTHER TIPS

I'm sorry if was unclear about my question, i found a solution googling around, i cant believe i didnt see this before:

https://developers.facebook.com/docs/android/scrumptious/authenticate/

This answered all of my questions.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top