Managing Facebook Session in Android App throughout multiple activities with Facebook SDK 3

别等时光非礼了梦想. 提交于 2019-12-01 08:37:45

You must always refer to the unique Session class. Every activity has to take an already opened session from the Session class or, if no valid sessions are found, created a new one. The method for doing this is Session.getActiveSession().
Then, in each activity, you add the callback that define the logic related to a session state change.

The UiLifecycleHelper is a very useful class that can help you manage the session state among the activities lifecycle (for example the onPause() method of this class deal with the removal of the callback added in the activity in which it's called)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!