title: Puzzling behavior with REORDER_TO_FRONT
body: <p>Activity A starts activity B with no flags. The stack is now A-B with B on top. B starts activity A with FLAG_ACTIVITY_REORDER_TO_FRONT (the only flag). I would expect the stack to now be B-A. However, when the back button is pressed at this point it returns to the home screen. Here I would expect Activity B to be brought to the front. Upon clicking on the launcher icon again, the app opens with B as the running activity and nothing in the stack.</p>
  
  <p>Launchmode is standard (default) in the manifest. </p>
  
  <p>Is this the expected behavior and I'm just not understanding it properly?</p>
  
  <p>EDIT: I have created a test project with no confounding factors and still see the same behavior. I just don't understand it, it doesn't seem to be per the documentation.</p>
  
  <p>EDIT: To me this behavior seems to be a BUG in the framework, see my comment on answer below. I need a workaround.</p>
  
  <p><code><pre>
  public class MainActivity extends Activity
  {
      @Override
      protected void onCreate(Bundle savedInstanceState)
      {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
      }</p>
  
  <pre><code>@Override
  public boolean onCreateOptionsMenu(Menu menu)
  {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.main, menu);
      return true;
  }
  public void onClickBtn(View view)
  {
      Intent flowIntent = new Intent(this, SecondActivity.class);
      startActivity(flowIntent);
  }
  </code></pre>
  
  <p>}</p>
  
  <p>public class SecondActivity extends Activity
  {
      @Override
      protected void onCreate(Bundle savedInstanceState)
      {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_second);
      }</p>
  
  <pre><code>@Override
  public boolean onCreateOptionsMenu(Menu menu)
  {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.main, menu);
      return true;
  }
  public void onClickBtn(View view)
  {
      Intent flowIntent = new Intent(this, MainActivity.class);
      flowIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
      startActivity(flowIntent);
  
  }
  </code></pre>
  
  <p>}
  </pre></code></p>
  
  <p>Manifest:
  <code><pre>
  &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;manifest xmlns:android=&quot;<a href="http://schemas.android.com/apk/res/android&amp;quot" rel="noreferrer">http://schemas.android.com/apk/res/android&amp;quot</a>;
      package=&quot;com.example.tester&quot;
      android:versionCode=&quot;1&quot;
      android:versionName=&quot;1.0&quot; &gt;
   &lt;uses-permission android:name=&quot;android.permission.INTERNET&quot; /&gt;
      &lt;uses-permission android:name=&quot;android.permission.ACCESS_NETWORK_STATE&quot; /&gt;
      &lt;uses-sdk
          android:minSdkVersion=&quot;8&quot;
          android:targetSdkVersion=&quot;18&quot; /&gt;
      &lt;application
          android:allowBackup=&quot;true&quot;
          android:icon=&quot;@drawable/ic_launcher&quot;
          android:label=&quot;@string/app_name&quot;
          android:theme=&quot;@style/AppTheme&quot; &gt;
          &lt;activity
              android:name=&quot;com.example.tester.MainActivity&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;com.example.tester.SecondActivity&quot; /&gt;
      &lt;/application&gt;
  &lt;/manifest&gt;
  </code></pre></p>