How do I set the style of a textView programmatically?

android, android-styles, styles, textview

Solution

You can't programmatically set the style of a View, but you might be able to do something like `textView.setTextAppearance(context, android.R.style.TextAppearance_Small);`.

Problem

I'm creating a textView programmatically. Is there a way that i can set the style of this textView? Something similar to ``` style="@android:style/TextAppearance.DeviceDefault.Small" ``` which I would use if I had a `layout.xml` file.

Original source

Related problems