<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Why does findViewById return null?</title>
	<atom:link href="http://www.balistupa.com/blog/2009/07/why-does-findviewbyid-return-null/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.balistupa.com/blog/2009/07/why-does-findviewbyid-return-null/</link>
	<description>Bali Stupa Blog</description>
	<lastBuildDate>Fri, 03 Feb 2012 17:22:57 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: lonewolf</title>
		<link>http://www.balistupa.com/blog/2009/07/why-does-findviewbyid-return-null/#comment-1084</link>
		<dc:creator>lonewolf</dc:creator>
		<pubDate>Tue, 15 Nov 2011 20:59:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.balistupa.com/blog/?p=69#comment-1084</guid>
		<description>Thank you for the post, it got me on the right track.

I used the following in main.xml:
android:id=”@+id/deviceidtext”

and got the same null pointer. 


After changing the code to:
android:id=”@+id/devicetext”

The program was able to retrieve the correct view.

It seems that the parser looks into the naming string aswell for &quot;id&quot; and cannot resolve the situation</description>
		<content:encoded><![CDATA[<p>Thank you for the post, it got me on the right track.</p>
<p>I used the following in main.xml:<br />
android:id=”@+id/deviceidtext”</p>
<p>and got the same null pointer. </p>
<p>After changing the code to:<br />
android:id=”@+id/devicetext”</p>
<p>The program was able to retrieve the correct view.</p>
<p>It seems that the parser looks into the naming string aswell for &#8220;id&#8221; and cannot resolve the situation</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dexterminio</title>
		<link>http://www.balistupa.com/blog/2009/07/why-does-findviewbyid-return-null/#comment-1080</link>
		<dc:creator>dexterminio</dc:creator>
		<pubDate>Sat, 15 Oct 2011 17:50:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.balistupa.com/blog/?p=69#comment-1080</guid>
		<description>When you&#039;re code is ok, and the null reference is returned, you need to clean your project.
Note: To clean the project means to clear out the cache (like the web browser when a page is loaded), so the new changes will be there.
In the menu (eclipse menu) Project-&gt;Clean...
When ask about about the project to Clean, you select &quot;Clean all projects&quot; or &quot;Clean projects selected below&quot;.
Press the ok button and is done, the project will run ok.</description>
		<content:encoded><![CDATA[<p>When you&#8217;re code is ok, and the null reference is returned, you need to clean your project.<br />
Note: To clean the project means to clear out the cache (like the web browser when a page is loaded), so the new changes will be there.<br />
In the menu (eclipse menu) Project-&gt;Clean&#8230;<br />
When ask about about the project to Clean, you select &#8220;Clean all projects&#8221; or &#8220;Clean projects selected below&#8221;.<br />
Press the ok button and is done, the project will run ok.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maverick</title>
		<link>http://www.balistupa.com/blog/2009/07/why-does-findviewbyid-return-null/#comment-1076</link>
		<dc:creator>Maverick</dc:creator>
		<pubDate>Fri, 30 Sep 2011 04:48:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.balistupa.com/blog/?p=69#comment-1076</guid>
		<description>Thanks a lot man!!! mine i was using android:id=&quot;@+id/okbutton&quot; from the starting but problem was that i was using a relative layout and had the other component id references with the &quot;+&quot; sign and hence this stupid parser was always returning null when i do findViewById</description>
		<content:encoded><![CDATA[<p>Thanks a lot man!!! mine i was using android:id=&#8221;@+id/okbutton&#8221; from the starting but problem was that i was using a relative layout and had the other component id references with the &#8220;+&#8221; sign and hence this stupid parser was always returning null when i do findViewById</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: xian.wang</title>
		<link>http://www.balistupa.com/blog/2009/07/why-does-findviewbyid-return-null/#comment-1075</link>
		<dc:creator>xian.wang</dc:creator>
		<pubDate>Wed, 21 Sep 2011 16:53:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.balistupa.com/blog/?p=69#comment-1075</guid>
		<description>Thanks so much!  I was using &quot;android:id&quot; instead of &quot;android:name&quot; to solving this problem.   thank your blog~~~</description>
		<content:encoded><![CDATA[<p>Thanks so much!  I was using &#8220;android:id&#8221; instead of &#8220;android:name&#8221; to solving this problem.   thank your blog~~~</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Slawek</title>
		<link>http://www.balistupa.com/blog/2009/07/why-does-findviewbyid-return-null/#comment-1062</link>
		<dc:creator>Slawek</dc:creator>
		<pubDate>Tue, 24 May 2011 17:31:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.balistupa.com/blog/?p=69#comment-1062</guid>
		<description>Hi,
I am new to Android and I&#039;m trying to figure it out, why I have to call setContentView before findViewById? All inner classes from R.class are static, so they should be initalized before runtime. I can&#039;t find answer and your blog was first site where is article about that.</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I am new to Android and I&#8217;m trying to figure it out, why I have to call setContentView before findViewById? All inner classes from R.class are static, so they should be initalized before runtime. I can&#8217;t find answer and your blog was first site where is article about that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GYI</title>
		<link>http://www.balistupa.com/blog/2009/07/why-does-findviewbyid-return-null/#comment-1032</link>
		<dc:creator>GYI</dc:creator>
		<pubDate>Wed, 12 Jan 2011 05:02:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.balistupa.com/blog/?p=69#comment-1032</guid>
		<description>Excellent: problem solved. I was using name=&#039;@+id/var&#039; instead of android:id=&#039;@id/var&#039; (it still generated ids in the R.java file which threw me off).</description>
		<content:encoded><![CDATA[<p>Excellent: problem solved. I was using name=&#8217;@+id/var&#8217; instead of android:id=&#8217;@id/var&#8217; (it still generated ids in the R.java file which threw me off).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: RockU</title>
		<link>http://www.balistupa.com/blog/2009/07/why-does-findviewbyid-return-null/#comment-916</link>
		<dc:creator>RockU</dc:creator>
		<pubDate>Tue, 12 Oct 2010 07:26:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.balistupa.com/blog/?p=69#comment-916</guid>
		<description>Thanks so much. I have been stuck on this for quite a while.</description>
		<content:encoded><![CDATA[<p>Thanks so much. I have been stuck on this for quite a while.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://www.balistupa.com/blog/2009/07/why-does-findviewbyid-return-null/#comment-800</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Sun, 13 Jun 2010 20:21:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.balistupa.com/blog/?p=69#comment-800</guid>
		<description>Oye! Thanks so much! I&#039;ve been struggling with this for hours. damn setContentView...</description>
		<content:encoded><![CDATA[<p>Oye! Thanks so much! I&#8217;ve been struggling with this for hours. damn setContentView&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric</title>
		<link>http://www.balistupa.com/blog/2009/07/why-does-findviewbyid-return-null/#comment-789</link>
		<dc:creator>Eric</dc:creator>
		<pubDate>Fri, 23 Oct 2009 23:17:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.balistupa.com/blog/?p=69#comment-789</guid>
		<description>thanks dude! I&#039;ve been trying to get a reference to a TextView that I have as part of a custom xml list layout for hours (I was missing the android bit from id on the TextView element)
Eric</description>
		<content:encoded><![CDATA[<p>thanks dude! I&#8217;ve been trying to get a reference to a TextView that I have as part of a custom xml list layout for hours (I was missing the android bit from id on the TextView element)<br />
Eric</p>
]]></content:encoded>
	</item>
</channel>
</rss>

