title: Layout possibly useless - no it isn't
body: <p>I'm new to Android development and have created a layout that looks like this:</p>
  
  <pre><code>RelativeLayout
     ScrollView
        LinearLayout
           TextView
  </code></pre>
  
  <p>The compiler complains about the ScrollView being "possibly useless". As discussed in [<a href="https://stackoverflow.com/questions/8711878/android-layout-creation-issue]">android layout creation issue</a>, I could get rid of the warning by putting ScrollView at the top of the hierarchy, removing the redundant RelativeLayout. However, I want to keep the RelativeLayout, because I am going to add more stuff at runtime. Is it possible to tell the compiler that I want to keep this particular layout? Basically, I want to get rid of the warning, but I don't want to disable this kind of warning altogether.</p>
  
  <p>EDIT: Although the full code is irrelevant to the question, here it comes:</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  tools:context=".MainFragment" &gt;
  
      &lt;ScrollView
          android:id="@+id/main_scrollview"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentTop="true" &gt;
          &lt;LinearLayout
              android:paddingBottom="@dimen/activity_vertical_margin"
              android:paddingLeft="@dimen/activity_horizontal_margin"
              android:paddingRight="@dimen/activity_horizontal_margin"
              android:paddingTop="@dimen/activity_vertical_margin"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:orientation="vertical" &gt;
              &lt;TextView
                  android:id="@+id/textView2"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="@string/test_right" 
                  android:textSize="@dimen/test_right_textsize"/&gt;
          &lt;/LinearLayout&gt;
      &lt;/ScrollView&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>EDIT: For clarification: The thing that I want to add at runtime is another ScrollView that is independent of the ScrollView in the layout, i.e. the new ScrollView is supposed to hover on top of the rest, overlapping it, hence the RelativeLayout.</p>