Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
要在 android 应用程序的后台运行进程,您可以使用 AsyncTask。是否有类似的方式在 java 中的基本 cmd 行应用程序的后台运行某些东西?
它可以像创建一个扩展类一样简单Thread(对不起,纯粹主义者,但这是最短的方法:)
Thread
new Thread() { public void run() { // Do something here } }.start();
包中有一堆更高级的工具,java.util.concurrent如果你需要做比这更复杂的事情,你应该看看。
java.util.concurrent