जब मैं परिदृश्य मोड में स्विच, निम्नलिखित कस्टम दृश्य एंड्रॉयड 1.5r3 कप केक में एक अपवाद फेंकता है:ग़लत स्थिति वर्ग - कस्टम दृश्य के साथ एंड्रॉयड 1.5 में उम्मीद कर देखें राज्य अपवाद
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);
}
}
इस दृश्य के लिए एक्सएमएल काफी सरल है:
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true"
android:id="@+id/progress" />
<TextView
android:text="Loading..."
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
कोई विचार क्या हो रहा है?
मैन हाँ ... ट्रैक करना मुश्किल है। –
वाह, आपने मुझे इस चीज़ पर घंटों खर्च करने से बचाया, thx! – Maragues
यह मेरा भी गलत था ... युक्ति: हाइराची दर्शक इसे आसानी से दृश्यमान बनाता है –