Is thera any way one can define style attributes in XML file and apply them to widgets created at run time.
Attributes
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#0000ff"
android:typeface="serif"
android:textSize="15sp"
And i am creating a button to which i want to apply these
Button b = new Button(this);
A good application explained in detail way here. This example using a style to set for its own widget.
Hope this will help you.