Static variables can't be saved in onSaveInstanceState?
<p>Consider following code, it saves static variable: mMyArray in onSaveInstanceState and restore it in onRestoreInstanceState, however I found it can't save the int array at all. I tried primative type value (int), it can save/restore primative type value.</p>

<pre><code>public class StaticVarActivity extends Activity {

    private static final String TAG = "StaticVarActivity";

    private static int[] mMyArray = { 1, 1 };

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        Log.d(TAG, "Setting values to 2 in onCreate");
        mMyArray[0] = 2;
        mMyArray[1] = 2;

        findViewById(R.id.btn).setOnClickListener(new OnClickListener() {

            public void onClick(View v) {
                Log.d(TAG, "Setting values to 3 in onClick");
                mMyArray[0] = 3;
                mMyArray[1] = 3;
            }
        });
    }

    /* (non-Javadoc)
     * @see android.app.Activity#onRestoreInstanceState(android.os.Bundle)
     */
    @Override
    protected void onRestoreInstanceState(Bundle savedInstanceState) {
        super.onRestoreInstanceState(savedInstanceState);

        Log.d(TAG,"onRestoreInstanceState 1:"+mMyArray[0]+","+mMyArray[1]);
        mMyArray = savedInstanceState.getIntArray("key");
        Log.d(TAG,"onRestoreInstanceState 2:"+mMyArray[0]+","+mMyArray[1]);

    }

    /* (non-Javadoc)
     * @see android.app.Activity#onSaveInstanceState(android.os.Bundle)
     */
    @Override
    protected void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        Log.d(TAG,"onSaveInstanceState 1:"+mMyArray[0]+","+mMyArray[1]);
        //int[] sss = new int[]{mMyArray[0],mMyArray[1]};
        //outState.putIntArray("key", sss);
        outState.putIntArray("key", mMyArray);
        Log.d(TAG,"onSaveInstanceState 2:"+mMyArray[0]+","+mMyArray[1]);
    }
}
</code></pre>

<p>The log:</p>

<hr>

<p>04-14 15:16:00.633: DEBUG/StaticVarActivity(7251): Setting values to 2 in onCreate
04-14 15:16:19.843: DEBUG/StaticVarActivity(7251): Setting values to 3 in onClick</p>

<p><strong>// Make configure change, e.g change orientation</strong></p>

<p>04-14 15:16:23.893: DEBUG/StaticVarActivity(7251): onSaveInstanceState 1:3,3
04-14 15:16:23.893: DEBUG/StaticVarActivity(7251): onSaveInstanceState 2:3,3
04-14 15:16:24.073: DEBUG/StaticVarActivity(7251): Setting values to 2 in onCreate
04-14 15:16:24.073: DEBUG/StaticVarActivity(7251): onRestoreInstanceState 1:2,2
04-14 15:16:24.073: DEBUG/StaticVarActivity(7251): onRestoreInstanceState 2:2,2</p>

<hr>

<p>If I change  to:</p>

<pre><code>private int[] mMyArray = { 1, 1 };
</code></pre>

<p>The log will be:</p>

<hr>

<p>04-14 15:18:29.183: DEBUG/StaticVarActivity(7355): Setting values to 2 in onCreate
04-14 15:18:32.123: DEBUG/StaticVarActivity(7355): Setting values to 3 in onClick</p>

<p><strong>// Make configure change, e.g change orientation</strong></p>

<p>04-14 15:18:33.353: DEBUG/StaticVarActivity(7355): onSaveInstanceState 1:3,3
04-14 15:18:33.353: DEBUG/StaticVarActivity(7355): onSaveInstanceState 2:3,3
04-14 15:18:33.373: DEBUG/StaticVarActivity(7355): Setting values to 2 in onCreate
04-14 15:18:33.393: DEBUG/StaticVarActivity(7355): onRestoreInstanceState 1:2,2
04-14 15:18:33.393: DEBUG/StaticVarActivity(7355): onRestoreInstanceState 2:3,3</p>

<hr>

<p>I got to know it doesn't need to save the static variable, but why this happen?</p>
