백그라운드 스레드를 시작하면 스레드가 종료되기 전에 finishes()에서 시작된 활동이 발생하면 어떻게됩니까? 스레드가 종료되거나 살아있을 것입니까? 당신이 당신의 스레드 언제든지 죽을 수/응용 알고 들어활동이 끝나면 쓰레드가 죽는가?
new Thread(new Runnable() {
public void run() {
while (mProgressStatus > 0) {
// Update the progress bar
mHandler.post(new Runnable() {
public void run() {
progressbar.setProgress(mProgressStatus);
}
});
}
}
}).start();
스레드가 죽지 않고 메모리 누수가 발생합니다. –
비슷한 질문이 여기에 있습니다 : [http://stackoverflow.com/questions/6208443/what-happens-to-an-android-thread-after-the-activity-that-created-it-is-destroye] – Martin