title: The first Activity is destroyed when pressing Back button from SecondActivity
body: <p>I'm implementing an Android app playing online Video and get the error. For the simplicity, I made an sample app here. There are 2 activities: MainActivity and SecondActivity.</p>
  
  <pre><code>MainActivity
  
  public class MainActivity extends Activity {
      public static String TAG = "MainActivity";
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          Log.e(TAG, "onCreate");
          setContentView(R.layout.activity_main);
  
          ((Button)findViewById(R.id.btn)).setOnClickListener(new OnClickListener() {
  
              @Override
              public void onClick(View v) {
                  // TODO Auto-generated method stub
                  Intent intent = new Intent(getApplicationContext(), SecondActivity.class);
                  startActivity(intent);
              }
          });
      }
  
      @Override
      protected void onStart() {
          // TODO Auto-generated method stub
          super.onStart();
          Log.e(TAG, "onStart");
      }
  
      @Override
      protected void onResume() {
          // TODO Auto-generated method stub
          super.onResume();
          Log.e(TAG, "onResume");
      }
  
      @Override
      protected void onStop() {
          // TODO Auto-generated method stub
          super.onStop();
          Log.e(TAG, "onStop");
      }
  
      @Override
      protected void onDestroy() {
          // TODO Auto-generated method stub
          super.onDestroy();
          Log.e(TAG, "onDestroy");
      }
  }
  
  SecondActivity
  
  public class SecondActivity extends Activity {
      public static String TAG = "SecondActivity";
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_second);
          setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
      }
  
      @Override
      protected void onStart() {
          // TODO Auto-generated method stub
          super.onStart();
          Log.e(TAG, "onStart");
      }
  
      @Override
      protected void onResume() {
          // TODO Auto-generated method stub
          super.onResume();
          Log.e(TAG, "onResume");
      }
  
      @Override
      protected void onStop() {
          // TODO Auto-generated method stub
          super.onStop();
          Log.e(TAG, "onStop");
      }
  
      @Override
      protected void onDestroy() {
          // TODO Auto-generated method stub
          super.onDestroy();
          Log.e(TAG, "onDestroy");
      }
  
      @Override
      public void onConfigurationChanged(Configuration newConfig) {
          // TODO Auto-generated method stub
          super.onConfigurationChanged(newConfig);
          Log.e(TAG, "onConfigurationChanged");
      }
  }
  
  AndroidManifiest.xml    
  
      &lt;activity
          android:name="com.example.androidtest.MainActivity"
          android:screenOrientation="portrait"
          android:label="@string/app_name" &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;
      &lt;activity
          android:name="com.example.androidtest.SecondActivity"
          android:label="@string/title_activity_second" 
          android:configChanges="orientation|keyboardHidden|screenSize"
          android:screenOrientation="portrait"&gt;
      &lt;/activity&gt;
  </code></pre>
  
  <p>In <code>MainActivity</code> has a button to start <code>SecondActivity</code>. My scenario is putting the device in landscape mode and click button to start <code>SecondActivity</code>(so that <code>SecondActivity</code> is auto rotated to landscape mode). Then pressing Back button immediately to return back <code>MainActivity</code>. But the <code>MainActivity</code> is destroyed. Here is my log:</p>
  
  <pre><code>12-11 22:22:20.940: E/MainActivity(400): onCreate
  12-11 22:22:20.960: E/MainActivity(400): onStart
  12-11 22:22:20.960: E/MainActivity(400): onResume
  12-11 22:22:24.524: E/SecondActivity(400): onStart
  12-11 22:22:24.524: E/SecondActivity(400): onResume
  12-11 22:22:24.544: E/SecondActivity(400): onConfigurationChanged
  12-11 22:22:24.634: E/MainActivity(400): onStop
  12-11 22:22:24.634: E/MainActivity(400): onDestroy
  12-11 22:22:34.133: E/SecondActivity(400): onStop
  12-11 22:22:34.133: E/SecondActivity(400): onDestroy
  </code></pre>
  
  <p>The <code>MainActivity</code> is destroyed and the current activity is <code>SecondActivity</code>. If I press Back one more, the <code>SeconActivity</code> is destroyed.
  Anyone can explain me why <code>MainActivity</code> is destroyed or this is error of Android OS.
  Thanks in advance.<br>
  <strong>P/S</strong>: For this case happens, putting the device in landscape, then clicking button to start SecondActivity and press Back immediately.<br>
  The OTHER cases works fine. </p>