title: Android MenuItem setActionView(null) crash
body: <p>On android 4.0.3 if you call <code>MenuItem.setActionView(null)</code> and then rotate the screen, my application will crash.</p>
  
  <p>What I am trying to do is emulate the <code>actionbar</code> of the <strong>GMail</strong> app where if you click an item it turns into a <code>progress bar</code>.</p>
  
  <p>However, it now saves the state of the <code>ActionView</code> and when it tries to restore it it says this.</p>
  
  <blockquote>
    <p>Unable to start activity ComponentInfo{}:
    java.lang.ClassCastException: android.view.AbsSavedState$1 cannot be
    cast to android.widget.ProgressBar$SavedState</p>
  </blockquote>
  
  <p>Does anyone have working code for this? or a way to fix it?</p>
  
  <p>Oh I use <code>actionbarsherlock</code> if that matter. It shouldn't because on <strong>4.03</strong> it just calls all the system calls.</p>
  
  <p>Code:</p>
  
  <pre><code>OnCreate()
      refreshMenuActionView = new ProgressBar(this.getActivity());
      refreshMenuActionView.setIndeterminateDrawable(this.getActivity().getResources().getDrawable(R.drawable.refresh_spinner));
  
  AsyncTask.onPostExecute
                  if ( refreshMenuItem != null ) {
                      refreshMenuItem.setActionView(null);
                  }
  
      @Override
  public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
      inflater.inflate(R.menu.loadable_menu, menu);
      refreshMenuItem = menu.findItem(R.id.refreshMenuItem);
      if ( downloader != null &amp;&amp; downloader.getStatus() == AsyncTask.Status.RUNNING ) {
              refreshMenuItem.setActionView(refreshMenuActionView);
      }
      searchMenuItem = menu.findItem(R.id.searchMenuItem);
      super.onCreateOptionsMenu(menu, inflater);
  }
  </code></pre>
  
  <p>XML:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;menu xmlns:android="http://schemas.android.com/apk/res/android" &gt;
      &lt;item
          android:id="@+id/refreshMenuItem"
          android:title="@string/refresh_item_title"
          android:icon="@drawable/ic_menu_refresh"
          android:showAsAction="ifRoom" /&gt;
      &lt;item
          android:id="@+id/searchMenuItem"
          android:title="@string/search_item_title"
          android:icon="@drawable/ic_menu_search"
          android:showAsAction="always" /&gt;
  &lt;/menu&gt;
  </code></pre>