title: How to animate on finish() via ActivityOptions in Android?
body: <p>I'm working on an app that has two activities, Main and Info. The App is started with the MainActivity and when you click a button the InfoActivity slides in from the right side. When you click another button, InfoActivity shall slide out to the right side again and Main returns.</p>
  
  <p>This is how I implemented the Animation and the Button Click in MainActivity:</p>
  
  <pre><code>buttonInfo.setOnClickListener(new View.OnClickListener() { 
      public void onClick(View v) {
         Intent i = new Intent(getApplicationContext(), Info.class);
         Bundle mAnimate = 
            ActivityOptions.makeCustomAnimation(getApplicationContext(),
             R.anim.ani1,R.anim.ani2).toBundle();
  
            startActivity(i,mAnimate);
              }
          });
  </code></pre>
  
  <p>I did it similar in the InfoActivity, which works fine. However, i want and need to call finish() instead of startActivity with an intent, because I have a server connection in the MainActivity which disconnects when i call startActivity.</p>
  
  <p>Any Ideas how to apply an animation like that to the finish() method or other suggestions?</p>