title: "java.lang.IllegalStateException: Activity has been destroyed" when press onBackPressed()
body: <p>I have an activity with an animated fragment. When I press on backpressed to close the activity I get this error. What does it mean?</p>
  
  <pre><code>  01-24 12:41:24.407: E/AndroidRuntime(23621):    FATAL EXCEPTION: main
   01-24 12:41:24.407: E/AndroidRuntime(23621):     java.lang.IllegalStateException: Activity has been destroyed
   01-24 12:41:24.407: E/AndroidRuntime(23621):   at android.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1351)
   01-24 12:41:24.407: E/AndroidRuntime(23621):   at android.app.BackStackRecord.commitInternal(BackStackRecord.java:595)
   01-24 12:41:24.407: E/AndroidRuntime(23621):   at android.app.BackStackRecord.commit(BackStackRecord.java:574)
   01-24 12:41:24.407: E/AndroidRuntime(23621):   at com.eni.enim4s.TranslucentActivity$1.run(TranslucentActivity.java:70)
   01-24 12:41:24.407: E/AndroidRuntime(23621):   at android.os.Handler.handleCallback(Handler.java:725)
   01-24 12:41:24.407: E/AndroidRuntime(23621):   at android.os.Handler.dispatchMessage(Handler.java:92)
   01-24 12:41:24.407: E/AndroidRuntime(23621):   at android.os.Looper.loop(Looper.java:176)
   01-24 12:41:24.407: E/AndroidRuntime(23621):   at android.app.ActivityThread.main(ActivityThread.java:5279)
   01-24 12:41:24.407: E/AndroidRuntime(23621):   at java.lang.reflect.Method.invokeNative(Native Method)
   01-24 12:41:24.407: E/AndroidRuntime(23621):   at java.lang.reflect.Method.invoke(Method.java:511)
   01-24 12:41:24.407: E/AndroidRuntime(23621):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
   01-24 12:41:24.407: E/AndroidRuntime(23621):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
   01-24 12:41:24.407: E/AndroidRuntime(23621):   at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>  public class TranslucentActivity extends Activity {
  
  private Fragment fragment;
  private FrameLayout frame;
  private android.app.FragmentTransaction ft;
  private android.app.FragmentManager fragmentManager;
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      super.onCreate(savedInstanceState);
      requestWindowFeature(Window.FEATURE_NO_TITLE);
      setContentView(R.layout.translucent);
  
       frame =(FrameLayout)findViewById(R.id.container);
    }
  
  @Override
  public void onWindowFocusChanged(boolean hasFocus) {
      // TODO Auto-generated method stub
      super.onWindowFocusChanged(hasFocus);
          frame.postDelayed(new Runnable() {
  
          @Override
              public void run() {
                  // TODO Auto-generated method stub
           fragment = new ViewDetail();
           fragmentManager = getFragmentManager(); 
           ft = fragmentManager.beginTransaction(); 
          ft.setCustomAnimations(R.animator.trans_left_in,R.animator.trans_left_out);
          ft.addToBackStack(null); 
          ft.replace(R.id.container, fragment, "Dettaglio"); 
          ft.commit();//the error is here
  
  
              }
          }, 500);
  }
  
  
  
  
   @Override
       public void onBackPressed() {
      super.onBackPressed();
      this.finish();
     }
  </code></pre>
  
  <p>}</p>