callback中不能使用Thread.sleep(2000)啊,使用后,callback进行了操作,但是就不显示出来了···直接显示了handler中的操作啊·
private Handler handler3=new Handler(new Callback() {
@Override
public boolean handleMessage(Message msg) {
Toast.makeText(MainActivity.this, "Callback", Toast.LENGTH_SHORT).show();
textview.setText("arg1:"+msg.arg1+"--arg2:"+msg.arg2+"\nperson:"+msg.obj.toString());
msg.arg1=msg.arg1+msg.arg2;
return false;
}
}){
public void handleMessage(Message msg) {
Toast.makeText(MainActivity.this, "handleMessage", Toast.LENGTH_SHORT).show();
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
textview.setText("arg1:"+msg.arg1+"\nperson:"+msg.obj.toString());
}
};