title: Run a method when opening a new activity
body: <p>here there is my problem.</p>
  
  <p>Activty1 -> startActivity(Activity2) -> Activity2 -> startActivity(Activity1)->Activity1.
  When I open the Activity1 from the Activity2 I would like to run a method in Activity1. So:</p>
  
  <p>Activty1 -> startActivity(Activity2) -> Activity2 -> startActivity(Activity1)->Activity1 and run method();
  How can I do that?</p>
  
  <pre><code>  public void domandaSuccessiva(View view){
  
     Intent intent = new Intent(CorrettoActivity.this, PrimaDomanda.class;
      startActivity(intent);
      PrimaDomanda primaDomanda = new PrimaDomanda();
      primaDomanda.mostraDomanda();
  
  
  
  
  
  }
  </code></pre>