Hi everyone.

I have a relative layout that I want to change the background
according to a set of features. For some reason when I try to change
the background image I get a null pointer exception. Currently in the
onStart method I call a function the handles valedating then determins
what background image should show. The code for the image change I
have is below:

RelativeLayout background =
(RelativeLayout)findViewById(R.id.currentWeatherBackground);
                        
background.setBackgroundResource(R.drawable.blue_background);


blue_background is in my resource folder and I can use it just fine if
I type it into the XML.

Could anyone please shed some light on what I am doing wrong?

Thank you for your time and help,

Tommy

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to