You can implement the activity intent at the Session.StatusCallback, after the session facebook is opened
For example:
private Session.StatusCallback statusCallback = new Session.StatusCallback() {
@Override
public void call(Session session, SessionState state,
Exception exception) {
if (state.isOpened()) {
Log.d(TAG, "Facebook session opened.");
if (session.isOpened()) {
Log.d(TAG, session.getAccessToken());
Intent intent = new Intent(this,
MainActivity.class);
startActivity(intent);
}
} else if (state.isClosed()) {
Log.d(TAG, "Facebook session closed.");
}
}
};