【发布时间】:2011-10-01 03:53:08
【问题描述】:
我想使用 textview 显示字母。并且 字母应该在一段时间后显示在 textview 中。
我使用了以下代码....
String a="Apple";
String b="";
.......
.......
public void run() {
for (int i = 0; i < 5; i++) {
b=b+""+a.charAt(i);
mTextView.setText(b); //Problem here
Log.d("Letters",""+b);
try {
sleep(2000);
} catch (InterruptedException e) {}
}
记录猫结果:
android.view.ViewRoot$CalledFromWrongThreadException:只有创建视图层次结构的原始线程才能触摸其视图。
任何解决方案?
【问题讨论】:
标签: java android multithreading time