title: how to finish another activity
body: <blockquote>
    <p>i have two activity such as test1 and test2. i want to close test2 activity in test1 activity.i need to close test2 activity in test1 activity button click. how to do it,</p>
  </blockquote>
  
  <pre><code>test1activitybutton.setOnClickListener(new OnClickListener() {          
  
  
          public void onClick(View v) 
          {
  
           // need to close test2 activity    
          }
      });
  </code></pre>
  
  <blockquote>
    <p>i need to close in another class activity as above</p>
  </blockquote>