You get the style attribute from the AttributeSet, or most often what you do is just let context.obtainStyledAttributes take care of this for you.
On Wed, Feb 18, 2009 at 9:12 AM, Meryl Silverburgh < [email protected]> wrote: > > Hi, > > Can you please help me understand how android consturcts widget? > > I have these 2 cases, > > <com.mycompany.MyWidget android:id="@+id/mywidget_button" > style="@style/MyWidget"> > > <com.mycompany.MyWidget android:id="@+id/mywidget_button" > > > My question is why they call the same constructors (I have print statement: > public MyToggleWidget(Context context, AttributeSet attrSet) { > super(context, attrStet, R.attr.buttonStyleMyWidget); > } > > If so, How can I differentiate the case with a style attribute from > the case without a style attribute. > > > > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

