When I run this app it crashes. I even tried to use LinearLayout but then it doesn’t work either. What am i doing wrong guys?
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<CheckBox
android:id="@+id/CheckBox13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="CheckBox" />
<CheckBox
android:id="@+id/CheckBox12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="CheckBox" />
<CheckBox
android:id="@+id/CheckBox11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="CheckBox" />
<CheckBox
android:id="@+id/CheckBox10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="CheckBox" />
</ScrollView>
You may only have single direct child in ScrollView view
A scrollview can host only one direct child.
from:
http://developer.android.com/reference/android/widget/ScrollView.html
A ScrollView is a FrameLayout, meaning you should place one child in it containing the entire contents to scroll; this child may itself be a layout manager with a complex hierarchy of objects. A child that is often used is a LinearLayout in a vertical orientation, presenting a vertical array of top-level items that the user can scroll through.so you code should be like this
this is log cat……….