I\'m trying to use the TextView constructor with style like this:
TextView
TextView myText = new TextView(MyActivity.this, null, R.style.my_style);
I have only tested with EditText but you can use the method
public void setBackgroundResource (int resid)
to apply a style defined in an XML file.
Sine this method belongs to View I believe it will work with any UI element.
regards.