title: Android - launcher and back stack behavior
body: <p>As said <a href="http://developer.android.com/guide/components/tasks-and-back-stack.html" rel="nofollow noreferrer">here</a></p>
  <blockquote>
  <p>When the user leaves a task by pressing the Home button, the current activity is stopped and its task goes into the background. &lt;...&gt; If the user later resumes the task by selecting the launcher icon that began the task, the task comes to the foreground and resumes the activity at the top of the stack.</p>
  </blockquote>
  <p>So i prepared simple test</p>
  <p>Activity #1 == text mark and button with onClick set</p>
  <pre><code>    public class FirstActivity extends Activity {
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.first_layout);
      }
  
      public void onClick(View v)
      {
          Intent intent = new Intent(FirstActivity.this, SecondActivity.class);
          startActivity(intent);
      }
  }
  </code></pre>
  <p>Activity #2 == just text mark</p>
  <pre><code>    public class SecondActivity extends Activity {
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.second_layout);
      }
  }
  </code></pre>
  <p>And manifest</p>
  <pre><code>&lt;manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
            package=&quot;com.example&quot;
            android:versionCode=&quot;1&quot;
            android:versionName=&quot;1.0&quot;&gt;
      &lt;uses-sdk android:minSdkVersion=&quot;10&quot;/&gt;
      &lt;application android:label=&quot;@string/app_name&quot; android:icon=&quot;@drawable/ic_launcher&quot;&gt;
          &lt;activity android:name=&quot;FirstActivity&quot;
                    android:label=&quot;@string/app_name&quot;&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name=&quot;android.intent.action.MAIN&quot;/&gt;
                  &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot;/&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
  
          &lt;activity android:name=&quot;SecondActivity&quot;
                    android:label=&quot;@string/app_name&quot;&gt;
          &lt;/activity&gt;
  
      &lt;/application&gt;
  &lt;/manifest&gt;
  </code></pre>
  <p>Launcher icon does not show me last activity, it is always launchs first activity and put it into stack. So in one task there might be many first and many second activities. Icon from recent apps list launch exact last activity in stack.
  What am i doing wrong?</p>