Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid Question: Nested Linear Layouts / R.Java Problem?
    primarykey
    data
    text
    <p>I read at another forum that someone else had this problem, he said he resolved it, but he didn't post the solution. My R.Java doesn't seem to be updating with the id's in the nested LinearLayouts. The first two id's in the textViews do appear in the R.Java (textView1 and textView2), but none of the subsequent id's for the ImageButtons do...and I suspect it's because of the layout (but being a noobie I have no idea why). </p> <p>The layout as I have it is almost perfect, so I'd hate to rewrite it if I can avoid it. But I don't know how to get the R.java to include the ID's. And I've tried the usual build clean, refresh, etc. Any help would be greatly appreciated by me and my computer...because if I can't figure this out soon, I'll probably end up throwing it out the window in frustration. :)</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" &gt; &lt;TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="86dp" android:background="@drawable/backgdtest" android:text=" Title of App" android:textColor="#ffffff" android:textSize="30px" android:textStyle="bold"/&gt; &lt;TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:text=" " android:layout_height="wrap_content"&gt;&lt;/TextView&gt; &lt;TableRow android:layout_width="fill_parent" android:weightSum="3" android:layout_height="wrap_content"&gt; &lt;LinearLayout android:layout_weight="1" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content"&gt; &lt;ImageButton android:id="@+id/news" android:src="@drawable/news" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;&lt;/ImageButton&gt; &lt;TextView android:layout_width="wrap_content" android:text=" Read News" android:layout_height="wrap_content"&gt;&lt;/TextView&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:layout_weight="1" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content"&gt; &lt;ImageButton android:id="@+id/messages" android:src="@drawable/message" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;&lt;/ImageButton&gt; &lt;TextView android:layout_width="wrap_content" android:text=" Messages" android:layout_height="wrap_content"&gt;&lt;/TextView&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:layout_weight="1" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content"&gt; &lt;ImageButton android:id="@+id/phonebook" android:src="@drawable/phonebook" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;&lt;/ImageButton&gt; &lt;TextView android:layout_width="wrap_content" android:text=" Phone Book" android:layout_height="wrap_content"&gt;&lt;/TextView&gt; &lt;/LinearLayout&gt; &lt;/TableRow&gt; &lt;TableRow android:layout_width="fill_parent" android:weightSum="3" android:layout_height="wrap_content"&gt; &lt;LinearLayout android:layout_weight="1" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content"&gt; &lt;ImageButton android:id="@+id/planner" android:src="@drawable/planner" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;&lt;/ImageButton&gt; &lt;TextView android:layout_width="wrap_content" android:text=" Day Planner" android:layout_height="wrap_content"&gt;&lt;/TextView&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:layout_weight="1" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content"&gt; &lt;ImageButton android:id="@+id/help" android:src="@drawable/panic" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;&lt;/ImageButton&gt; &lt;TextView android:layout_width="wrap_content" android:text=" Call For Help" android:layout_height="wrap_content"&gt;&lt;/TextView&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:layout_weight="1" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content"&gt; &lt;ImageButton android:id="@+id/exit" android:src="@drawable/exit" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;&lt;/ImageButton&gt; &lt;TextView android:layout_width="wrap_content" android:text=" Exit Program" android:layout_height="wrap_content"&gt;&lt;/TextView&gt; &lt;/LinearLayout&gt; &lt;/TableRow&gt; </code></pre> <p></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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.
 

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