Once I click the button, I want text of different sizes to be displayed. I tried using the built-in html support for it but I found out that font size tag is not supporI'm using a TextView to do this but I keep getting an error saying "could not execute method of the activity".
Here is my activity main part:
<TextView
android:id="@+id/header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="32px" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/rams"
android:onClick="ramsShow" />
I have the header string resource in string.xml:
<string name="header">Header</string>
This is the method in my MainActivity that is called when the button is clicked:
public void ramsShow(View view)
{
TextView test= new TextView(this);
test = (TextView) findViewById(R.id.header);
String tmp = "hi";
test.setText(tmp);
}