Note that there are some explanatory texts on larger screens.

plurals
  1. PONull Pointer Exception in an Android Table Layout
    primarykey
    data
    text
    <p>I created an xml file using Eclipse for an Android app that I was creating. After finishing all the layouts, and doing some coding and such, I found out that the final product needed to be on an earlier API level (10 to be exact). So I began the process of rolling back the code and the xml files, but have run into a problem that I can't solve, and doesn't seem to have any documentation. I created a table layout, and have many table rows. When I try to run the program on the virtual device, I'm given a Null Pointer Exception with regards to the TableRow.measureNullChild(int) function, the code of which is: </p> <pre><code>@Override int measureNullChild(int childIndex) { return mConstrainedColumnWidths[childIndex]; } </code></pre> <p>Obviously the problem is in there somewhere, but I'm not sure of the exact specifics, and was wondering if anybody else has had this problem. I'll now post the xml file that causes the crash:</p> <pre><code>&lt;TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/livelayout" android:layout_width="fill_parent" android:layout_height="fill_parent"&gt; &lt;TableRow android:id="@+id/tableRow8" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingTop="5dp" &gt; &lt;RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/hope" &gt; &lt;/RelativeLayout&gt; &lt;/TableRow&gt; &lt;TableRow android:id="@+id/tableRow7" android:layout_width="wrap_content" android:layout_height="wrap_content" &gt; &lt;TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="30dp" android:layout_gravity="center_vertical" android:layout_margin="0dp" android:gravity="center" android:paddingLeft="0dp" android:paddingTop="0dp" android:text="@string/us" android:textSize="28dp" android:textColor="#CC7F32" /&gt; &lt;FrameLayout android:layout_width="wrap_content" android:layout_height="wrap_content" &gt; &lt;TextView android:id="@+id/TextView01" android:layout_width="70dp" android:layout_height="30dp" android:layout_margin="0dp" android:gravity="center" android:paddingLeft="0dp" android:paddingTop="0dp" android:text="@string/them" android:textSize="26dp" android:textColor="#CC7F32" /&gt; &lt;/FrameLayout&gt; &lt;/TableRow&gt; &lt;TableRow android:id="@+id/tableRow2" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center_vertical" android:visibility="visible" &gt; &lt;Button android:id="@+id/us2" android:layout_width="70dp" android:layout_height="50dp" android:text="@string/us2" /&gt; &lt;Button android:id="@+id/us2made" android:layout_width="70dp" android:layout_height="50dp" android:text="@string/us2m" /&gt; &lt;Button android:id="@+id/button3" android:layout_width="70dp" android:layout_height="50dp" android:text="@string/them2" /&gt; &lt;Button android:id="@+id/button4" android:layout_width="70dp" android:layout_height="50dp" android:text="@string/them2m" /&gt; &lt;/TableRow&gt; &lt;TableRow android:id="@+id/tableRow1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_vertical" &gt; &lt;Button android:id="@+id/button5" android:layout_width="70dp" android:layout_height="50dp" android:text="@string/us1" /&gt; &lt;Button android:id="@+id/button6" android:layout_width="70dp" android:layout_height="50dp" android:text="@string/us1m" /&gt; &lt;Button android:id="@+id/button7" android:layout_width="70dp" android:layout_height="50dp" android:text="@string/them1" /&gt; &lt;Button android:id="@+id/button8" android:layout_width="70dp" android:layout_height="50dp" android:text="@string/them1m" /&gt; &lt;/TableRow&gt; &lt;TableRow android:id="@+id/tableRow3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_vertical" &gt; &lt;Button android:id="@+id/button9" android:layout_width="70dp" android:layout_height="50dp" android:text="@string/us3" /&gt; &lt;Button android:id="@+id/button10" android:layout_width="70dp" android:layout_height="50dp" android:text="@string/us3m" /&gt; &lt;Button android:id="@+id/button11" android:layout_width="70dp" android:layout_height="50dp" android:text="@string/them3" /&gt; &lt;Button android:id="@+id/button12" android:layout_width="70dp" android:layout_height="50dp" android:text="@string/them3m" /&gt; &lt;/TableRow&gt; &lt;TableRow android:id="@+id/tableRow4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_vertical" &gt; &lt;Button android:id="@+id/button13" android:layout_width="70dp" android:layout_height="50dp" android:text="@string/usOreb" /&gt; &lt;Button android:id="@+id/button14" android:layout_width="70dp" android:layout_height="50dp" android:text="@string/usXreb" /&gt; &lt;Button android:id="@+id/button15" android:layout_width="70dp" android:layout_height="50dp" android:text="@string/themOreb" /&gt; &lt;Button android:id="@+id/button16" android:layout_width="70dp" android:layout_height="50dp" android:text="@string/themXreb" /&gt; &lt;/TableRow&gt; &lt;TableRow android:id="@+id/tableRow5" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_vertical" &gt; &lt;Button android:id="@+id/button17" android:layout_width="70dp" android:layout_height="50dp" android:text="@string/us2f" /&gt; &lt;Button android:id="@+id/button18" android:layout_width="70dp" android:layout_height="50dp" android:text="@string/us2fm" /&gt; &lt;Button android:id="@+id/button19" android:layout_width="70dp" android:layout_height="50dp" android:padding="5dp" android:text="@string/them2f" /&gt; &lt;Button android:id="@+id/button20" android:layout_width="70dp" android:layout_height="50dp" android:padding="5dp" android:text="@string/them2fm" /&gt; &lt;/TableRow&gt; &lt;TableRow android:id="@+id/tableRow6" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingTop="30dp" &gt; &lt;/TableRow&gt; &lt;FrameLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingLeft="60dp" android:paddingRight="60dp" &gt; &lt;Button android:id="@+id/button21" android:layout_width="201dp" android:layout_height="match_parent" android:text="Button" /&gt; &lt;/FrameLayout&gt; &lt;FrameLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingLeft="60dp" android:paddingRight="60dp" android:paddingTop = "15dp" &gt; &lt;Button android:id="@+id/Button01" android:layout_width="201dp" android:layout_height="match_parent" android:text="Button" /&gt; &lt;/FrameLayout&gt; &lt;/TableLayout&gt; </code></pre> <p>Any help would be absolutely fantastic, as I've been stuck here for like two days, and haven't been able to figure out what's wrong. I'll be sure to post here if I do though so that googlers can find the answer if this happens to them. Thanks in advance</p> <p>EDIT: After removing all rows but one, that contains content, I get the same error in the same spot</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload