зеркало из https://github.com/mono/mail-archives.git
102 строки
4.1 KiB
HTML
102 строки
4.1 KiB
HTML
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
||
|
<HTML>
|
||
|
<HEAD>
|
||
|
<TITLE> [mono-android] FindViewById keeps returning null for an included layout
|
||
|
</TITLE>
|
||
|
<LINK REL="Index" HREF="index.html" >
|
||
|
<LINK REL="made" HREF="mailto:monodroid%40lists.ximian.com?Subject=%5Bmono-android%5D%20FindViewById%20keeps%20returning%20null%20for%20an%20included%0A%09layout&In-Reply-To=">
|
||
|
<META NAME="robots" CONTENT="index,nofollow">
|
||
|
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||
|
<LINK REL="Previous" HREF="008050.html">
|
||
|
<LINK REL="Next" HREF="008051.html">
|
||
|
</HEAD>
|
||
|
<BODY BGCOLOR="#ffffff">
|
||
|
<H1>[mono-android] FindViewById keeps returning null for an included layout</H1>
|
||
|
<B>Luke Stevens</B>
|
||
|
<A HREF="mailto:monodroid%40lists.ximian.com?Subject=%5Bmono-android%5D%20FindViewById%20keeps%20returning%20null%20for%20an%20included%0A%09layout&In-Reply-To="
|
||
|
TITLE="[mono-android] FindViewById keeps returning null for an included layout">lstevens at asiweb.com
|
||
|
</A><BR>
|
||
|
<I>Thu Dec 22 18:23:49 EST 2011</I>
|
||
|
<P><UL>
|
||
|
<LI>Previous message: <A HREF="008050.html">[mono-android] Default New Project cannot run in android emulator
|
||
|
</A></li>
|
||
|
<LI>Next message: <A HREF="008051.html">[mono-android] UnsatisfiedLinkError
|
||
|
</A></li>
|
||
|
<LI> <B>Messages sorted by:</B>
|
||
|
<a href="date.html#8045">[ date ]</a>
|
||
|
<a href="thread.html#8045">[ thread ]</a>
|
||
|
<a href="subject.html#8045">[ subject ]</a>
|
||
|
<a href="author.html#8045">[ author ]</a>
|
||
|
</LI>
|
||
|
</UL>
|
||
|
<HR>
|
||
|
<!--beginarticle-->
|
||
|
<PRE>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="<A HREF="http://schemas.android.com/apk/res/android"">http://schemas.android.com/apk/res/android"</A>>
|
||
|
<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: <A HREF="http://mono-for-android.1047100.n5.nabble.com/FindViewById-keeps-returning-null-for-an-included-layout-tp5095897p5095897.html">http://mono-for-android.1047100.n5.nabble.com/FindViewById-keeps-returning-null-for-an-included-layout-tp5095897p5095897.html</A>
|
||
|
Sent from the Mono for Android mailing list archive at Nabble.com.
|
||
|
</PRE>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<!--endarticle-->
|
||
|
<HR>
|
||
|
<P><UL>
|
||
|
<!--threads-->
|
||
|
<LI>Previous message: <A HREF="008050.html">[mono-android] Default New Project cannot run in android emulator
|
||
|
</A></li>
|
||
|
<LI>Next message: <A HREF="008051.html">[mono-android] UnsatisfiedLinkError
|
||
|
</A></li>
|
||
|
<LI> <B>Messages sorted by:</B>
|
||
|
<a href="date.html#8045">[ date ]</a>
|
||
|
<a href="thread.html#8045">[ thread ]</a>
|
||
|
<a href="subject.html#8045">[ subject ]</a>
|
||
|
<a href="author.html#8045">[ author ]</a>
|
||
|
</LI>
|
||
|
</UL>
|
||
|
|
||
|
<hr>
|
||
|
<a href="http://lists.ximian.com/mailman/listinfo/monodroid">More information about the Monodroid
|
||
|
mailing list</a><br>
|
||
|
</body></html>
|