final TextView textbox = (TextView) findViewById(R.id.display_number);
for(int i = 0; i <li.size();i++)
{
int k = li.get(i);
String strI = Integer.toString(k);
textbox.setText(strI);
try
{
Thread.sleep(1000);
}
catch (InterruptedException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
想从数组里 取值 每取一个值停顿下(所以就设置了sleep) 就跟新一次。
------解决思路----------------------
写个handler
private Handler mHandler = new Handler(){
@Override
public void handleMessage(Message msg) {
switch(msg.what) {
case UPDATE_TEXTVIEW:
textbox.setText(strI);
break;
}
super.handleMessage(msg);
}
};
然后发送更新的消息就好了
Message msg = new Message();
msg.what = UPDATE_TEXTVIEW;
mHandler.sendMessageDelayed(msg, 1000);