On Sat, Apr 2, 2011 at 1:55 PM, Raghav Sood <[email protected]> wrote: > Thanks Mark, > > This is what I got from the phone log:
:: snip :: > 04-02 23:04:46.726 E/AndroidRuntime(25262): Caused by: > java.lang.NullPointerException > 04-02 23:04:46.726 E/AndroidRuntime(25262): at > android.app.Activity.findViewById(Activity.java:1637) > 04-02 23:04:46.726 E/AndroidRuntime(25262): at > com.raghavsood.mp.matchpuzzler.<init>(matchpuzzler.java:14) This tells you where you are going wrong. You cannot call findViewById() from an initializer. You have to wait until *after* setContentView() before calling findViewById(). -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9.2 Available! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

