title: My app crashes after starting activity with scrollview
body: <p>I have a problem with an Android application. In the app there is an xml file which contains a RelativeLayout and inside a Scroll view. Inside the scrollview there some images which I want to display. The problem is that when there are 3 ImageView inside the scrollview the activity and the xml page works fine but ,when I add the 4th ImageView , application crashes when I start the activity. </p>
  
  <p>I am posting the code below, the problem occurs when the 4th ImageView is added.  Any ideas?</p>
  
  <pre><code>&lt;ScrollView
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
      android:orientation="vertical"
      android:alwaysDrawnWithCache="true"
      android:fadeScrollbars="true"
      android:verticalScrollbarPosition="right"&gt;
  
      &lt;RelativeLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:background="#FFFFFF"
          android:gravity="center"
          android:orientation="vertical"&gt;
  
          &lt;ImageView
              android:id="@+id/Double_image"
              android:layout_width="match_parent"
              android:layout_height="200dp"
              android:scaleType="centerCrop"
              android:src="@drawable/trouble" /&gt;
  
          &lt;ImageView
              android:id="@+id/Secret_image"
              android:layout_width="match_parent"
              android:layout_height="200dp"
              android:layout_below="@+id/Double_image"
              android:scaleType="centerCrop"
              android:src="@drawable/secret" /&gt;
  
          &lt;ImageView
              android:id="@+id/kidnap_image"
              android:layout_width="match_parent"
              android:layout_height="200dp"
              android:layout_below="@id/Secret_image"
              android:scaleType="centerCrop"
              android:src="@drawable/kidnap" /&gt;
  
          &lt;ImageView
                  android:id="@+id/kidnap2_image"
                  android:layout_width="match_parent"
                  android:layout_height="200dp"
                  android:layout_below="@id/kidnap_image"
                  android:scaleType="centerCrop"
                  android:src="@drawable/kidnap2" /&gt;
  
  
      &lt;/RelativeLayout&gt;
  &lt;/ScrollView&gt;
  </code></pre>
  
  <p>NOTE: The activity which is connected with this xml file doesn't have any functionality.</p>
  
  <p>Here is the Activity class connected with the above xml.</p>
  
  <pre><code>package com.example.thomas.firstcue;
  
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  
  public class RoomsActivity extends AppCompatActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_rooms);
      }
  }
  </code></pre>
  
  <p>I start the activity from Main through a button click and the function StartActivity</p>
  
  <pre><code>  rooms_but.setOnClickListener(new View.OnClickListener(){
          @Override
          public void onClick(View view) {
  
              startActivity(intentrooms);
  
          }
  
      });
  </code></pre>
  
  <p>The application starts normally on phone but when I am pressing the button to Start the activity , the app crashes.
  <a href="https://i.stack.imgur.com/4D1Ge.jpg" rel="nofollow noreferrer">On phone error</a></p>