当我注释掉计数器并使用消息运行它时,它工作正常。但它不会显示整数。在我的研究中,我发现显示字符串的示例代码与显示整数的示例代码之间没有区别。也许我可以在某个地方查看指南?或者一个简单的答案也将不胜感激。谢谢。
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);
}
}