I'm implementing facebook's sdk to sign in to my app. I have two Activities that I call Login and Home. When I click the login button, login is done perfectly and Activity Home is instantiated as soon as the onSessionStateChange method is called:
private void onSessionStateChange(Session session, SessionState state,
Exception exception) {
if (state.isOpened()) {
Intent intent = new Intent(getActivity().getBaseContext(), HomeActivity.class);
startActivity(intent);
getActivity().finish();
} else if (state.isClosed()) {
Log.i(TAG, "Logged out...");
}
}
The problem is that the instance code is twice the activity activity.