title: interstitial error android unable to pause activity
body: <p>I have one issue with interstitial ads .
  I am getting error unable to pause activity when I am trying to handle <code>onAdClosed()</code> method</p>
  
  <p>Here I am using fragments  </p>
  
  <p>Here I am posting my logcat output </p>
  
  <pre><code>03-18 19:28:50.169: E/AndroidRuntime(26349): FATAL EXCEPTION: main
  03-18 19:28:50.169: E/AndroidRuntime(26349): java.lang.RuntimeException: Unable to pause  
  activity {com.social_sweep.app/com.google.android.gms.ads.AdActivity}:
  java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
  
  03-18 19:28:50.169: E/AndroidRuntime(26349):at
  android.app.ActivityThread.performPauseActivity(ActivityThread.java:2846)
  
  03-18 19:28:50.169: E/AndroidRuntime(26349): at
  android.app.ActivityThread.performPauseActivity(ActivityThread.java:2802)
  03-18 19:28:50.169: E/AndroidRuntime(26349): at
  android.app.ActivityThread.handlePauseActivity(ActivityThread.java:2780)
  03-18 19:28:50.169: E/AndroidRuntime(26349):at
  android.app.ActivityThread.access$800(ActivityThread.java:133)
   03-18 19:28:50.169: E/AndroidRuntime(26349):at
  android.app.ActivityThread$H.handleMessage(ActivityThread.java:1220)
  03-18 19:28:50.169: E/AndroidRuntime(26349):at
  android.os.Handler.dispatchMessage(Handler.java:99)
  03-18 19:28:50.169: E/AndroidRuntime(26349):    at
  android.os.Looper.loop(Looper.java:137)
  03-18 19:28:50.169: E/AndroidRuntime(26349):    at
  android.app.ActivityThread.main(ActivityThread.java:4794)
  03-18 19:28:50.169: E/AndroidRuntime(26349):    at
  java.lang.reflect.Method.invokeNative(Native Method)
  03-18 19:28:50.169: E/AndroidRuntime(26349):    at
  java.lang.reflect.Method.invoke(Method.java:511)
  03-18 19:28:50.169: E/AndroidRuntime(26349):    at
  com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
  03-18 19:28:50.169: E/AndroidRuntime(26349):    at
  com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
  03-18 19:28:50.169: E/AndroidRuntime(26349):    at
  dalvik.system.NativeStart.main(Native Method)
  03-18 19:28:50.169: E/AndroidRuntime(26349): Caused by: java.lang.IllegalStateException:
  Can not perform this action after onSaveInstanceState
  03-18 19:28:50.169: E/AndroidRuntime(26349):    at
  android.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:1280)
  03-18 19:28:50.169: E/AndroidRuntime(26349):    at
  android.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1291)
  03-18 19:28:50.169: E/AndroidRuntime(26349):    at
  android.app.BackStackRecord.commitInternal(BackStackRecord.java:548)
  03-18 19:28:50.169: E/AndroidRuntime(26349):    at
  android.app.BackStackRecord.commit(BackStackRecord.java:532)
  03-18 19:28:50.169: E/AndroidRuntime(26349):    at
  com.social_sweep.app.SelectEvent$3$1.onAdClosed(SelectEvent.java:461)
  03-18 19:28:50.169: E/AndroidRuntime(26349):    at
  com.google.android.gms.internal.t.onAdClosed(Unknown Source)
  03-18 19:28:50.169: E/AndroidRuntime(26349):    at
  com.google.android.gms.internal.ab$a.onTransact(Unknown Source)
  03-18 19:28:50.169: E/AndroidRuntime(26349):    at
  android.os.Binder.transact(Binder.java:326)
  android.os.Binder.transact(Binder.java:326)
  03-18 19:28:50.169: E/AndroidRuntime(26349):    at
  com.google.android.gms.internal.bs$a$a.onPause(Unknown Source)
  03-18 19:28:50.169: E/AndroidRuntime(26349):    at
  com.google.android.gms.ads.AdActivity.onPause(Unknown Source)
  03-18 19:28:50.169: E/AndroidRuntime(26349):    at
  android.app.Activity.performPause(Activity.java:5219)
  03-18 19:28:50.169: E/AndroidRuntime(26349):    at
  android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1225)
  03-18 19:28:50.169: E/AndroidRuntime(26349):    at
  android.app.ActivityThread.performPauseActivity(ActivityThread.java:2833)
  03-18 19:28:50.169: E/AndroidRuntime(26349):    ... 12 more
  </code></pre>
  
  <p>Here is my code what I am doing ,</p>
  
  <pre><code> if (fragment != null) {
               interstitial.setAdListener(new AdListener() {
  
               public void onAdLoaded() {
  
               displayInterstitial();
  
               }
  
               public void onAdClosed() {
              FragmentManager fragmentManager = getFragmentManager();
              fragmentManager
                      .beginTransaction()
                      .setCustomAnimations(R.animator.slide_in_left,
                              R.animator.slide_out_right,
                              R.animator.slide_in_left,
                              R.animator.slide_out_right)
                      .replace(R.id.frame_container, fragment)..commitAllowingStateLoss();
  
              // update selected item and title, then close the
              // drawer
  
              getActivity().getActionBar().setTitle(Title);
               };
  
               });
  </code></pre>
  
  <p>Thanks in advance. </p>