public void saveInstanceState(Bundle outState) {
    ArrayList<String> callIds = new ArrayList<String>(pendingCallMap.keySet());
    outState.putStringArrayList(CALL_ID_ARRAY_KEY, callIds);

    for (FacebookDialog.PendingCall pendingCall : pendingCallMap.values()) {
      String stateKey = getSavedStateKeyForPendingCallId(pendingCall.getCallId().toString());
      outState.putParcelable(stateKey, pendingCall);
    }
  }
  public void restoreFromSavedInstanceState(Bundle savedInstanceState) {
    ArrayList<String> callIds = savedInstanceState.getStringArrayList(CALL_ID_ARRAY_KEY);
    if (callIds != null) {
      for (String callId : callIds) {
        String stateKey = getSavedStateKeyForPendingCallId(callId);
        FacebookDialog.PendingCall pendingCall = savedInstanceState.getParcelable(stateKey);

        if (pendingCall != null) {
          pendingCallMap.put(pendingCall.getCallId().toString(), pendingCall);
        }
      }
    }
  }
 public void trackPendingCall(FacebookDialog.PendingCall pendingCall) {
   if (pendingCall != null) {
     pendingCallMap.put(pendingCall.getCallId().toString(), pendingCall);
   }
 }