public void onCreate(Bundle savedInstanceState){
  Session session=Session.getActiveSession();
  if (session == null) {
    if (savedInstanceState != null) {
      session=Session.restoreSession(activity,null,callback,savedInstanceState);
    }
    if (session == null) {
      session=new Session(activity);
    }
    Session.setActiveSession(session);
  }
  if (savedInstanceState != null) {
    String callIdString=savedInstanceState.getString(DIALOG_CALL_ID_SAVE_KEY);
    if (callIdString != null) {
      pendingFacebookDialogCallId=UUID.fromString(callIdString);
    }
    pendingFacebookDialogCallStore.restoreFromSavedInstanceState(savedInstanceState);
  }
}

public void onCreate ( Bundle savedInstanceState ) { Session session = Session . getActiveSession ( ) ; if ( session == null ) { if ( savedInstanceState != null ) { session = Session . restoreSession ( activity , null , callback , savedInstanceState ) ; } if ( session == null ) { session = new Session ( activity ) ; } Session . setActiveSession ( session ) ; } if ( savedInstanceState != null ) { String callIdString = savedInstanceState . getString ( DIALOG_CALL_ID_SAVE_KEY ) ; if ( callIdString != null ) { pendingFacebookDialogCallId = UUID . fromString ( callIdString ) ; } pendingFacebookDialogCallStore . restoreFromSavedInstanceState ( savedInstanceState ) ; } }
to be called from an activity or fragment ' s oncreate method .
