[android-developers] Re: constructors on a View

2011-07-05 Thread Koh Chean Siong
Hi, Yes. As you seen all views in android contains all 3 types of constructors. When you are creating your own custom view, my best practices is to create all 3 of them as all of them are used in different situation. Start with (2) 2) View(Context,AttributeSet) - This will be called by android

[android-developers] Re: constructors on a View

2011-07-05 Thread doles
Thank you! That helps me understand this a bit further. I am still very hazy on how to make use of xml layouts in re-usable components, so at this point, the two longer constructors are no use to me, however, it seems like all three should be implemented if my code is to be turned over to other

[android-developers] Re: constructors on a View

2011-07-05 Thread Koh Chean Siong
Yeah, if you plan for re-use, it is better to implement them. On Jul 5, 4:17 pm, doles sachin.d...@gmail.com wrote: Thank you! That helps me understand this a bit further. I am still very hazy on how to make use of xml layouts in re-usable components, so at this point, the two longer