Set maximum column height in gridLayout to avoid overlapping
<p>in my app I am encountering this problem:
<a href="https://i.stack.imgur.com/qY5AE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qY5AE.png" alt="enter image description here"></a></p>

<p>As you can see i added the option to let the use specify a name through an edit text in an alertDialog. Hypotetically the user could enter an extremely long name, ruining the entire layout as the following rows will overlap. 
How can I enter a specified height and width for each row?</p>

<p>activity_main.xml</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;

&lt;GridView xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/gridview"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:columnWidth="90dp"
          android:numColumns="auto_fit"
          android:verticalSpacing="10dp"
          android:horizontalSpacing="10dp"
          android:stretchMode="columnWidth"
          android:gravity="center"
          android:longClickable="true"
    /&gt;
</code></pre>

<p>grid_item.xml</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- Layout for a single list item --&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:tools="http://schemas.android.com/tools"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:gravity="center_vertical"
              android:orientation="horizontal"
              android:minHeight="?android:attr/listPreferredItemHeight"
              android:padding="16dp"&gt;



        &lt;TextView
            android:id="@+id/text_1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            tools:text="test text"
            /&gt;


&lt;/LinearLayout&gt;
</code></pre>