title: Android: execute method after returning to main activity from intent activity
body: <p>I have seen many examples with</p>
  
  <pre><code>startActivityForResult(Intent, int)
  </code></pre>
  
  <p>and then using</p>
  
  <pre><code>onActivityResult(int, int, Intent) 
  </code></pre>
  
  <p>but for me I dont need to pass anything, I simply want to startActivity(intent), and when intent activity returns, a method get called in main activity..
  Any tutorial on doing this?</p>
  
  <p>EDIT:
  Here a sample code:</p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main_options);
  
      createEvent = (Button) findViewById(R.id.createEvent);
      createEvent.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              Intent intent = new Intent(optionsInterface.this, MainActivity.class);
              startActivity(intent);
          }
      });
  }
  </code></pre>
  
  <p>here, after I return from MainActivity (press back, or just close it), I want the activity to perform a task ( with no data being passed from MainActivity)</p>