How to generate Styled text for TextView while assembling string?
问题 I have a TextView that will hold a styled, multiline string. This text is generated line by line as the data is drawn from different sources bit by bit. As I grab each field, I add a Bold header to the TextView on a new line, then I add the data for that field in italics on a new line. Example formatting: Due Date July 22, 2010 Course CSC 350 I could set the styling like this: Spannable str = (Spannable) textview.getText(); str.setSpan(new StyleSpan(android.graphics.Typeface.Bold), 0, 8,