File was renamed from HDLSDK/hdl-common/src/main/java/com/hdl/sdk/common/utils/ThreadToolUtils.java |
| | |
| | | package com.hdl.sdk.common.utils;
|
| | | package com.hdl.sdk.link.common.utils;
|
| | |
|
| | |
|
| | | import java.util.concurrent.ExecutorService;
|
| | | import java.util.concurrent.Executors;
|
| | |
| | | private ThreadToolUtils() {
|
| | | }
|
| | |
|
| | | private static final ThreadToolUtils instance = new ThreadToolUtils();
|
| | | private static class SingletonInstance {
|
| | | private static final ThreadToolUtils INSTANCE = new ThreadToolUtils();
|
| | | }
|
| | |
|
| | | public static ThreadToolUtils getInstance() {
|
| | | return instance;
|
| | | return SingletonInstance.INSTANCE;
|
| | | }
|
| | |
|
| | |
|
| | |
| | | return Executors.newCachedThreadPool();
|
| | | }
|
| | |
|
| | | /**
|
| | | * 切换回主线程
|
| | | */
|
| | | public void runOnUiThread(Runnable run) {
|
| | | // uiHandler.post(run);
|
| | | Thread thread = new Thread(run);
|
| | | thread.start();
|
| | | }
|
| | | // /**
|
| | | // * 切换回主线程
|
| | | // */
|
| | | // public void runOnUiThread(Runnable run) {
|
| | | // uiHandler.post(run);
|
| | | // }
|
| | |
|
| | |
|
| | | }
|