我想同时启动两个线程。接收视频并将其存储在智能手机上的线程以及播放视频的线程。两者都没有,但它分开工作。我怎么能这样做?
public void startProgress(View view) {
ConcurrentLinkedDeque<OutputStream[]> list = new ConcurrentLinkedDeque<>();
/* Executor executor = new Executor() {
@Override
public void execute(Runnable command) {
command.run();
}
};*/
Thread t1 = new Thread(new Task2(list));
Thread t2 = new Thread(new Task(list));
t1.start();
t2.start();
/* executor.execute(t1);
executor.execute(t2);*/
}
谢谢。