Calyth Calyth - 25 days ago 10
Android Question

Programmatically use setTextSize to ?attr/textAppearanceLarge

I'm tinkering with a custom preference right now, and I want to give it a label using TextView. However I can't seem to find a way to specify the text size to "large" using setTextView()

What am I missing here?

Answer
TextView title = new TextView(context);
title.setTextAppearance(context, android.R.attr.textAppearanceLarge);

or try

setTextAppearance(context, android.R.style.TextAppearance_Large);

use the above code and try