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]