Cheers, that makes sense. I didnt notice the reference to the class in the lunar_layour xml.
On Dec 13, 3:58 pm, Mark Murphy <mmur...@commonsware.com> wrote: > RichardS wrote: > > Steve, I'm sure the instance is created by > > > setContentView(R.layout.lunar_layout) > > > so the constructor will have been run by the time we do > > > mLunarView = (LunarView) findViewById(R.id.lunar) > > Correct. > > If you look in res/layout/lunar_layout.xml, you will see the declaration: > > <com.example.android.lunarlander.LunarView > android:id="@+id/lunar" > android:layout_width="fill_parent" > android:layout_height="fill_parent"/> > > When the layout is inflated via setContentView(), the constructors for > each widget and container are called. For built-in widgets like > FrameLayout, Android knows they are in the package android.widget; for > custom ones, the full namespace is spelled out in the layout > (com.example.android.lunarlander.LunarView). > > -- > Mark Murphy (a Commons Guy)http://commonsware.com > _The Busy Coder's Guide to Android Development_ Version 1.9 Available! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---