View was clear data when screen rotation in Android
<p>I have a <strong><em>View</em></strong> that was created on runtime then I draw some canvas on that View(runtime) after that I rotated my screen.All data was gone(reset).So I put the some code in <strong><em>AndroidManifest.xml</em></strong> like this</p>

<pre><code>android:configChanges="keyboardHidden|orientation"
</code></pre>

<p>in my <code>&lt;activity&gt;</code> then I put a <code>@Override</code> function</p>

<pre><code>@Override
public void onConfigurationChanged(Configuration newConfig) {
  super.onConfigurationChanged(newConfig);      
  setContentView(R.layout.main);
  LinearLayout layout = (LinearLayout) findViewById(R.id.myPaint);
  layout.addView(mView); 
}
</code></pre>

<p>but everything couldn't solved my problem.I want to keep my data from View(runtime) on every single rotation.</p>

<p>That's my onCreate function.</p>

<pre><code>@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mView = new MyView(this);
    setContentView(mView);

    mView.requestFocus();
    setContentView(R.layout.main);
    LinearLayout layout = (LinearLayout) findViewById(R.id.myPaint);
    layout.addView(mView);
}
</code></pre>
