I have a xml with a ScrollView and a LinearLayout as a child of ScrollView.

```
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <ViewStub
        android:id="@+id/social_empty_stub"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:inflatedId="@+id/social_empty_stub_inflted"
        android:layout="@layout/empty_screen"
        android:visibility="gone" />

    <ScrollView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:id="@+id/activity_stream"
        android:background="#DCDCDCDC"
        android:fadingEdge="none" >

        <LinearLayout
            android:id="@+id/activity_stream_wrap"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical" >
        </LinearLayout>
    </ScrollView>

</RelativeLayout>

```

and I have another xml with a LinearLayout

```
<?xml version="1.0" encoding="utf-8"?>
<!-- List Item on activity stream -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:id="@+id/RelativeLayout_Activity_Streams"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:orientation="horizontal"
              android:paddingTop="5dp" >

    <!-- Avatar -->
    <com.example.bb.ShaderImageView
            android:id="@+id/imageView_Avatar"
            android:layout_width="@dimen/social_avatar_size"
            android:layout_height="@dimen/social_avatar_size"
            android:layout_marginLeft="5dp"
            android:scaleType="fitXY" />

    <!-- Content -->
    <LinearLayout
            android:id="@+id/relativeLayout_Content"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="2dip"
            android:layout_marginRight="5dp"
            android:background="@drawable/news_browser_background_shape"
            android:orientation="vertical"
            android:padding="5dp" >

        <TextView
                android:id="@+id/textView_Name"
                style="@style/textview_name"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="10dip"
                android:maxLines="5"
                android:textStyle="bold" />

        <TextView
                android:id="@+id/textView_Message"
                style="@style/textview_content"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="10dip"
                android:layout_marginTop="3dip"
                android:maxLines="5" />

        <TextView
                android:id="@+id/textview_temp_message"
                style="@style/textview_content"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="10dip"
                android:layout_marginTop="3dip"
                android:maxLines="5"
                android:visibility="gone" />

        <ViewStub
                android:id="@+id/attached_image_stub_activity"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:layout_marginBottom="2dp"
                android:inflatedId="@+id/attached_image_stub_inflate"
                android:layout="@layout/activity_image_display_layout"
                android:padding="5dp"
                android:visibility="gone" />

        <TextView
                android:id="@+id/activity_comment_view"
                style="@style/textview_content"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="10dip"
                android:layout_marginTop="3dip"
                android:maxLines="5"
                android:visibility="gone" />

        <RelativeLayout
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="3dp"
                android:layout_marginRight="10dp"
                android:layout_marginTop="7dp"
                android:gravity="center_vertical">

            <ImageView
                    android:id="@+id/activity_image_type"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:contentDescription="@string/ImageDesc"
                    android:layout_marginLeft="5dp"
                    android:padding="2dp"
                    android:scaleType="fitXY" />

            <!-- Time text view -->
            <TextView
                    android:id="@+id/textView_Time"
                    style="@style/textview_time"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_toRightOf="@id/activity_image_type"
                    android:layout_marginLeft="5dp"
                    android:layout_marginTop="5dp"
                    android:gravity="center_horizontal"
                    android:layout_marginRight="3dp" />

            <!-- Comment button -->
            <Button
                    android:id="@+id/button_Comment"
                    style="@style/textview_number"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentRight="true"
                    android:background="@drawable/social_activity_browser_comment_button_shape"
                    android:gravity="center_vertical"
                    android:padding="2dp" />

            <!-- Like button -->
            <Button
                    android:id="@+id/button_Like"
                    style="@style/textview_number"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_toLeftOf="@id/button_Comment"
                    android:background="@drawable/social_activity_browser_like_button_shape"
                    android:gravity="center_vertical"
                    android:padding="2dp" />

        </RelativeLayout>
    </LinearLayout>

</LinearLayout>

```

Now I want to add the LinearLayout in second xml programmatically in ScrollView of first xml. I am using following code

```
   setContentView(R.layout.activitybrowserview);  

   View view = LayoutInflater.from(context).inflate(R.layout.activitybrowserviewcell, null);
   LinearLayout ll = (LinearLayout) view.findViewById(R.id.RelativeLayout_Activity_Streams);
   ScrollView sv = (ScrollView) findViewById(R.id.activity_stream);
   sv.addView(ll);

```

I get following error, how can I avoid that. I don't understand the error.

IllegalStateException "Scrollview can host only one direct child"