i have in my android main.xml file as the following..
when i run it is showing some exception but in main.xml in graphical view it is not showing any error..
follwing is my code inside Linearlayout
<ScrollView android:id="@+id/ScrollView01"
android:layout_width="fill_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_gravity="top"
android:layout_height="match_parent">
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="UserName"/>
<EditText android:id="@+id/username"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text=""/>
<Button
android:id="@+id/login_button"
android:layout_width="60dp"
android:layout_height="30dp"
android:text="login"/>
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_gravity="top"
android:layout_height="match_parent">
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text=""/>
<EditText android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text=""/>
<Button
android:layout_width="60dp"
android:layout_height="30dp"
android:text="@string/login_btn"/>
</LinearLayout>
</ScrollView>
ScrollView should have ONLY ONE child. in ur example u have placed 2 linear layouts inside scrollview which is causing error..
place the 2 linear layouts inside 1 linear layout and place the whole thing in scrollview. it will work..