Wrong state class -- expecting View State exception in Android 1.5 with Custom View
<p>When I switch to landscape mode, the following custom view throws an exception in Android 1.5r3 cupcake:</p>

<pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.opentable/com.opentable.activity.SearchResults}: 
    java.lang.IllegalArgumentException: Wrong state class -- expecting View State


public class TextProgressBar extends LinearLayout {
    public TextProgressBar(Context context, AttributeSet attrs) {
        super(context, attrs);
        ((LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.text_progress_bar, this, true);
        setGravity(Gravity.CENTER);
    }

    public TextProgressBar(Context context) {
        this(context,null);
    }
}
</code></pre>

<p>The XML for this view is fairly straightforward:</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"&gt;

    &lt;ProgressBar
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:indeterminate="true"
        android:id="@+id/progress" /&gt;

    &lt;TextView
        android:text="Loading..."
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" /&gt;

&lt;/LinearLayout&gt;
</code></pre>

<p>Any ideas what might be happening?</p>
