Android orientation changing exceptions
<p>I'm having a hard time with the screen orientation in Android. I have an activity which captures a signature after the user draws his signature on the device. And for that activity I am passing a parceable object and I get it in oncreate. When the activity changes the orientation sometimes the activity cannot get the parceable object and gives an exception. I tried using a static object for the parceable object but no use. I tried onsaveinstance state method and onRetainNonConfigurationInstance methods as well. </p>

<pre><code>@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.signature_capture_view);
    Bundle bundle = getIntent().getExtras(); 
    info = bundle.getParcelable("info");
    logo= (Bitmap) bundle.get("logo");
}
</code></pre>

<p>And my save instance state method is like this;</p>

<pre><code>@Override
 protected void onSaveInstanceState(Bundle outState) {
 outState.putParcelable("info", info);
 super.onSaveInstanceState(outState);
 }
</code></pre>

<p></p>

<p>From the onconfiguration changed method i call the setcontentview method to set a fresh layout. </p>

<pre><code>@Override
public void onConfigurationChanged(Configuration newConfig) {
    setContentView(R.layout.signature_capture_view);
    super.onConfigurationChanged(newConfig);
}
</code></pre>

<p>Sometimes when the orientation changes an out of memory exception occurs from the setcontentview method. </p>

<p>Any help would be greatly appreciated. Thanks in advance. </p>
