I've been having some trouble lately accessing a layout that I'm adding to a
TableRow (and assigning an id to, because I want to re-use this layout file
multiple times) with an <include> in the XML.  The lines looks like this:  

 <TableRow>
    <include android:id="@+id/sumlabel1" layout="@layout/sumlabelcell"/>
  </TableRow>

The 'sumlabelcell' layout file looks like the following:

<?xml version="1.0" encoding="utf-8" ?>
<merge xmlns:android="http://schemas.android.com/apk/res/android";>
  <RelativeLayout
 android:id="@+id/sumLabelCell"
 android:layout_width="fill_parent"
 android:layout_height="fill_parent"
 android:background ="@color/summarydarkbackground"
  >

    <TextView
         android:id="@+id/sumLabelText"
         android:layout_width="fill_parent"
         android:layout_height="fill_parent"
         android:textColor="#ffffffff"
         android:padding = "15dp"

      />
  </RelativeLayout>
</merge>

Now, when I try to access 'sumLabelCell' directly, it works fine.  However,
when I try to access 'sumlabel1' with FindViewById, I always get a null
value returned.  Any ideas what I could be doing wrong here?  Thanks in
advance for the help!  

--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/FindViewById-keeps-returning-null-for-an-included-layout-tp5095897p5095897.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
[email protected]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to