title: How to animate an then finish a Dialog Activity on pressing back button in android?
body: <p>I have done the following. </p>
  
  <p>On moving from <code>cart_activity</code> which is an <code>Activity</code> to another <code>Dialog Activity</code> name <code>Order_Confrim_Dialog</code> I am using a bottom to top animation. </p>
  
  <p>What I am trying to do is on pressing the <code>keydown</code> button I want to animate the <code>Dialog Activity</code>. But the <code>keydown</code> or '<code>back</code> button simply closes the dialog activity without any animation. Can anyone correct my code? My code is as folllows:</p>
  
  <p>cart_activity.java</p>
  
  <pre><code>        Intent intDialog = new Intent(cart_activity.this, Order_Confrim_Dialog.class);
          startActivity(intDialog);
          overridePendingTransition(R.anim.slide_up_dialog, R.anim.slide_out_down); 
  </code></pre>
  
  <p>Order_Confirm_Dialog.java</p>
  
  <pre><code> @Override
  public void onBackPressed() {
      // TODO Auto-generated method stub
      // super.onBackPressed();
      Order_Confrim_Dialog.this.finish();
      overridePendingTransition(R.anim.close_down_dialog, 0);
  }
  </code></pre>