title: Add new row in horizontal linear layout
body: <p>I am creating dynamically images in linear layout with horizontal orientation. I am using:</p>
  
  <pre><code>ImageView imageView = new ImageView(getContext());
              imageView.setLayoutParams(new 
  android.view.ViewGroup.LayoutParams(200,200));
              imageView.setOnTouchListener(new MyTouchListener());
              imageView.setOnDragListener(new MyDragListener());
              setImageIcon(imageView, ap.getPackageName());
              topLayout.addView(imageView);
  </code></pre>
  
  <p>But at the end of the screen it continues to add icons in infinity on the right side. I somehow want to add border and start in new line.Is there any option that i can do that? Here is my xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/master_layout"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:columnCount="4"
          android:columnWidth="320dp"
          android:orientation="vertical"
          android:rowCount="8"
          android:stretchMode="columnWidth"&gt;
  
  &lt;LinearLayout
      android:id="@+id/top_layout"
      android:layout_width="match_parent"
      android:layout_height="280dp"
      android:layout_alignParentBottom="true"
      android:layout_alignParentLeft="true"
      android:layout_alignParentStart="true"
      android:background="@drawable/shape_droptarget_grey"
      android:gravity="left"
      android:orientation="horizontal"&gt;
      &lt;TextView android:id="@+id/text_top"
                android:layout_width="match_parent"
                android:layout_height="40dp"
                android:clickable="false"
                android:text="Security upgrade avaliable"
                android:textAlignment="center"
                android:textSize="28dp"/&gt;
  
  &lt;/LinearLayout&gt;
  
  
  &lt;LinearLayout
      android:id="@+id/bottom_layout"
      android:layout_width="match_parent"
      android:layout_height="280dp"
      android:layout_alignParentBottom="true"
      android:layout_alignParentLeft="true"
      android:layout_alignParentStart="true"
      android:background="@drawable/shape_droptarget_green"
      android:gravity="left"
      android:orientation="horizontal"&gt;
      &lt;TextView android:id="@+id/text_bottom"
                android:layout_width="match_parent"
                android:layout_height="40dp"
                android:clickable="false"
                android:gravity="center"
                android:text="Secured Apps"
                android:textAlignment="center"
                android:textSize="28dp"/&gt;
  
  &lt;/LinearLayout&gt;
  
  
  &lt;/GridLayout&gt;
  </code></pre>