我有几个球的阵列,我想首先,在大约半秒后绘制每个1,所以即时绘制球和绘制方法后我使用Thread.sleep,但当我运行应用程序时只是睡觉,然后它绘制所有的球。任何想法为什么?
public void draw(Canvas canvas)
{
Paint p = new Paint();
p.setColor(Color.RED);
for (int i = 0; i < this.arr.length; i++)
{
this.arr[i].draw(canvas, p);
if(this.count < this.arr.length)
{
this.count++;
try {
Thread.sleep(500);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}