★明白 handler 线程 同步 异步的定义 理解更快
public class MainActivity extends AppCompatActivity {
private TaskWork taskWorkA = new TaskWork();
private TaskWork taskWorkB = new TaskWork();
private TaskWork taskWorkC = new TaskWork();
private HandlerThread handlerThreadA = new HandlerThread("ThreadA");
private HandlerThread handlerThreadB = new HandlerThread("ThreadB");
private HandlerThread handlerThreadC = new HandlerThread("ThreadC");
private Handler handlerA;
private Handler handlerB;
private Handler handlerC;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initTaskWorkFirstType();
}
private class TaskRunnable implements Runnable {
private String taskName;
public TaskRunnable(String taskName) {
this.taskName = taskName;
}
@Override
public void run() {
Log.d(&#