Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/231.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Android UI线程会杀死什么_Java_Android_Multithreading - Fatal编程技术网

Java Android UI线程会杀死什么

Java Android UI线程会杀死什么,java,android,multithreading,Java,Android,Multithreading,在一个活动中,我派生出几个独立的线程。稍后,在其中一个子线程上,我进行以下调用: ((Activity) context).runOnUiThread(new Runnable() { public void run() { String message = "Exception thrown: Developer mode was enabled while " + "trying to access the app."; thr

在一个活动中,我派生出几个独立的线程。稍后,在其中一个子线程上,我进行以下调用:

((Activity) context).runOnUiThread(new Runnable() {
    public void run() {
        String message = "Exception thrown: Developer mode was enabled while " +
            "trying to access the app.";
        throw new RuntimeException(message);
    }
});

现在,UI线程还将杀死什么?其他的线也会死吗?当应用程序崩溃时,它仍在后台运行(我认为)

我认为与该进程相关的所有线程都将被终止(在单个进程模型场景中)。您可以通过运行

ps -t | grep [your-app-user-id]
RuntimeException前后的命令行

要获取应用程序的用户id,请执行以下操作:

ps | grep [your-package-name]