Re: [android-developers] Force close after adding resources and textview

2011-03-15 Thread Mark Sharpley
Hey everyone, thanks for taking the time time to reply. It really is appreciated! Implementing my initialization in onCreate() worked, fantastic stuff. Thanks again Mark On 11 March 2011 06:17, Dianne Hackborn hack...@android.com wrote: Don't implement a constructor and do stuff in it.

[android-developers] Force close after adding resources and textview

2011-03-10 Thread Mark Sharpley
I was playing around with the galleryview and image switcher, and I decided to implement a textview that describes my images as I scroll through them. I created a string array, and added a text view in my layout xml. I then added the string and textview to my code. I thought I could reuse the

Re: [android-developers] Force close after adding resources and textview

2011-03-10 Thread TreKing
On Thu, Mar 10, 2011 at 8:25 PM, Mark Sharpley m.c.sharp...@gmail.comwrote: However, this addition causes my app to force close when I try to run it. 03-11 02:00:59.288: ERROR/AndroidRuntime(12636): Caused by: java.lang.NullPointerException 03-11 02:00:59.288: ERROR/AndroidRuntime(12636):

[android-developers] Force close after adding resources and textview

2011-03-10 Thread Mark Sharpley
Line 36: Resources res = getResources(); -- 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

Re: [android-developers] Force close after adding resources and textview

2011-03-10 Thread TreKing
Line 36: Resources res = getResources(); (Copying from the new thread - not sure why that happened). Did you mean to call getResources(); *outside* of onCreate? - TreKing

Re: [android-developers] Force close after adding resources and textview

2011-03-10 Thread Dianne Hackborn
Don't implement a constructor and do stuff in it. Implement your initialization in onCreate(). On Thu, Mar 10, 2011 at 6:25 PM, Mark Sharpley m.c.sharp...@gmail.comwrote: I was playing around with the galleryview and image switcher, and I decided to implement a textview that describes my