Handler handler = new Handler() {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
}
};
new Thread(new Runnable() {
@Override
public void run() {
Message msg = Message.obtain();
msg.what = 1000;
msg.arg1 = 10;
handler.sendMessage(msg);
}
}).start();
private Handler.Callback callback = new Handler.Callback() {
@Override
public boolean handleMessage(Message msg) {
return true;
}
};
Handler handler1 = new Handler(callback);
new Thread(new Runnable() {
@Override
public void run() {
Message msg = Message.obtain();
msg.what = 1001;
msg.arg1 = 11;
handler1.sendMessage(msg);
}
}).start();
Handler handler = new Handler() {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
}
};
new Thread(new Runnable() {
@Override
public void run() {
handler.post(new Runnable() {
@Override
public void run() {
}
});
}
}).start();
Handler handler = new Handler() {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
}
};
new Thread(new Runnable() {
@Override
public void run() {
handler.postDelayed(new Runnable() {
@Override
public void run() {
}
}, 3000);
}
}).start();
new Thread(new Runnable() {
@Override
public void run() {
runOnUiThread(new Runnable() {
@Override
public void run() {
}
});
}
}).start();
new Thread(new Runnable() {
@Override
public void run() {
button.post(new Runnable() {
@Override
public void run() {
}
});
}
}).start();
new Thread(new Runnable() {
@Override
public void run() {
button.postDelayed(new Runnable() {
@Override
public void run() {
}
}, 3000);
}
}).start();