LongTimeResponse類代碼如下
package com
public class LongTimeResponse implements Runnable{
private Viewer viewer;
private int count;
public LongTimeResponse(Viewer viewer){
this
this
caculateNewCount();
}
private void caculateNewCount(){
Thread thread=new Thread(this);
thread
}
public void run(){
try{
Thread
}
catch(Exception ex){
ex
}
viewer
}
}
這說明
以上就是使用回調和線程處理一個耗時響應的整個過程
[
From:http://tw.wingwit.com/Article/program/Java/gj/201311/27716.html