title: android check if an activity was started from an action or from another activity?
body: <p>In my manifest file, I have an activity declaration which looks something like this:</p>
  
  <pre><code>&lt;activity android:name=".MainActivity"&gt;
            &lt;intent-filter&gt;
                &lt;action android:name="android.intent.action.MAIN" /&gt;
                &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
            &lt;/intent-filter&gt;
  &lt;/activity&gt;   
  </code></pre>
  
  <p>This activity is obviously launched on application start. User can navigate from this activity to another activity and from that one to another etc.
  In another activity, I start MainActivity by using 'startActivity' method, ie. something like:</p>
  
  <pre><code>Intent intent = new Intent(AnotherActivity.this, MainActivity.class);
  startActivity(intent);
  </code></pre>
  
  <p>In my <code>MainActivity</code> (in onCreate() method maybe), can I determine whether an activity was started from a action of from another activity? Is there something like "launcher listener"? I would like to avoid putting any extra content in the intent.
  Can I simply put <code>String s = getIntent().getAction();</code> in onCreate method and check whether it is has a value of MAIN?</p>