Android Activity being recreate when the starting next activity with different screen orientation
<p>I found that when we change the orientation of current activity by screen rotation, the previous activity will be recreated in background.</p>

<p>What I'm trying to say is, for example:</p>

<p>I had set the screen orientation for both activity in the manifest file</p>

<pre><code>&lt;activity android:screenOrientation="portrait" android:name="package.PotraitActivity"&gt;&lt;/activity&gt;
&lt;activity android:screenOrientation="landscape" android:name="package.MyActivity"&gt;&lt;/activity&gt;
</code></pre>

<p>In PotraitActivity.java,</p>

<pre><code>Button mybutton = (Button)findViewById(R.id.mybutton);
mybutton.setOnClickListener(new OnClickListener() {

  @Override
  public void onClick(View view) 
  {  Intent intent = new Intent(this,MyActivity.class);
     startActivity(intent);
  }
});
</code></pre>

<p>When clicked on myButton, LandscapeActivity was been started. But at the same time OnCreate() method in PotraitActivity was called as well.</p>

<p>I found the same thing happened when: </p>

<ol>
<li>the screen orientation for both activities is different or </li>
<li>Screen rotation is enabled for MyActivity (screenOrientation="user"). OnCreate() method in PotraitActivity is called every time we rotated MyActivity.</li>
</ol>

<p>Anyone has idea about this? </p>
