FileDocCategorySizeDatePackage
StyledText.javaAPI DocAndroid 1.5 API1629Wed May 06 22:41:08 BST 2009com.example.android.apis.content

StyledText

public class StyledText extends android.app.Activity
Demonstration of styled text resources.

Fields Summary
Constructors Summary
Methods Summary
protected voidonCreate(android.os.Bundle savedInstanceState)

        super.onCreate(savedInstanceState);

        // See assets/res/any/layout/styled_text.xml for this
        // view layout definition.
        setContentView(R.layout.styled_text);

        // Programmatically retrieve a string resource with style
        // information and apply it to the second text view.  Note the
        // use of CharSequence instead of String so we don't lose
        // the style info.
        CharSequence str = getText(R.string.styled_text);
        TextView tv = (TextView)findViewById(R.id.text);
        tv.setText(str);