title: Is there any way to keep a reference of an instance of a activity?
body: <p>Is there any way to keep a reference of an instance of a activity?</p>
  
  <p>Imagine i have below code :</p>
  
  <pre><code>    Intent intent=new Intent(this, OBDActivity.class);
      intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP |  Intent.FLAG_ACTIVITY_SINGLE_TOP);
      startActivity(intent);
  
      Activity openedActiviy = ????
  </code></pre>
  
  <p>Now I want to keep the instance of the OBDActivity that was opened somewhere cause I want to finish it later. instead of OBDActivity  it could be any other activity, in fact I want to have a variable that keeps the last opened activity.</p>
  
  <pre><code>openedActiviy.finish();
  </code></pre>
  
  <p>any idea ?</p>