我希望每 0.75 秒更新一次我的 UI,我不想使用 AnsyTask。但是 TextView 只设置在 for 循环的末尾,知道为什么吗?
...
robotWords = "........Hey hello user!!!";
wordSize = robotWords.length();
mHandler.postDelayed(r, 750);
}
private Runnable r = new Runnable()
{
public void run()
{
for(int i=0; i<wordSize; i++)
{
robotTextView.setText("why this words only display on the textView at last operation on this for loop?");
Log.i(TAG, robotWords.substring(0, i));
try
{
Thread.sleep(750);
} catch (InterruptedException e)
{
e.printStackTrace();
}
}
}
};