When I comment out counter and run it with message, it works fine. It will not display an integer though. During my research, I have found no difference between the example code to display a String versus displaying an integer. Perhaps there is a guide somewhere I can review? Or a simple answer would also be appreciated. Thanks.
package com.evorlor.testcode;
import android.app.Activity;
import android.os.Bundle;
import android.text.method.ScrollingMovementMethod;
import android.widget.TextView;
public class SupWorld extends Activity {
private String message;
private int counter;
/**
* @param args
*/
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// TODO Auto-generated method stub
message = "Sup world.";
counter = 123;
TextView text = new TextView(this);
text.setTextSize(100);
text.setMovementMethod(new ScrollingMovementMethod());
// text.setText(message);
text.setText(counter);
setContentView(text);
}
}
It is the right way to do it.