I wanted to place a working RadioGroup inside a ScrollView.
This main.xml caused the app to blow up on load… “Sorry! The application… has stopped unexpectedly. Please try again. Force close”
<ScrollView>
<RadioGroup android:id="@+id/types">
...
And this worked
<ScrollView>
<RadioGroup android:id="@+id/types" android:layout_width="wrap_content" android:layout_height="wrap_content">
....
My question, though, is how to figure this out? (aside from trying out random code I find on the Internet). On the force close, the stack trace seems to just be a bunch of launcher stuff, and never mentions my main.xml (using Debug mode in Eclipse with an AVD). Is there an error message somewhere that says that these attributes are missing?
How to Debug
You should see an error similar to this
in the logcat system debug output.
Requirements
Width and height are always required. In the Layout Parameters section in the “Declaring Layout” official Dev Guide, it says
Also in the “Layout Resource” Dev Guide, it is stated that all subclasses of View require these two attributes