public class DownloadResponseHandler extends Object
限定符和类型 | 字段和说明 |
---|---|
protected static int |
FAILURE_MESSAGE |
protected static int |
FINISH_MESSAGE |
protected static int |
PROGRESS_MESSAGE |
protected static int |
START_MESSAGE |
protected static int |
STOP_MESSAGE |
static String |
TAG |
protected static int |
WAIT_MESSAGE |
构造器和说明 |
---|
DownloadResponseHandler() |
限定符和类型 | 方法和说明 |
---|---|
protected void |
handleFailureMessage(Throwable e,
String responseBody) |
protected void |
handleFinishMessage(long end) |
protected void |
handleMessage(Message msg) |
protected void |
handleProgressMessage(long end,
int progress,
int speed) |
protected void |
handleStartMessage(long start,
long length) |
protected void |
handleStopMessage(long end) |
protected void |
handleWaitMessage() |
protected Message |
obtainMessage(int responseMessage,
Object response) |
void |
onFailure(Throwable error,
String content)
失败状态
|
void |
onFinish(long end)
完成状态
|
void |
onProgressUpdate(long end,
int progress,
int speed)
更新状态
|
void |
onStart(long start,
long length)
开始状态
|
void |
onStop(long end)
停止状态
|
void |
onWait()
等候状态
|
protected void |
sendFailureMessage(Exception e,
String responseBody) |
protected void |
sendFinishMessage(long end) |
protected void |
sendMessage(Message msg) |
protected void |
sendProgressMessage(long end,
int progress,
int speed) |
protected void |
sendStartMessage(long start,
long length) |
protected void |
sendStopMessage(long end) |
protected void |
sendWaitMessage() |
protected static final int WAIT_MESSAGE
protected static final int START_MESSAGE
protected static final int PROGRESS_MESSAGE
protected static final int STOP_MESSAGE
protected static final int FAILURE_MESSAGE
protected static final int FINISH_MESSAGE
public void onWait()
public void onStart(long start, long length)
start
- length
- public void onStop(long end)
end
- public void onFinish(long end)
end
- public void onProgressUpdate(long end, int progress, int speed)
end
- progress
- speed
- protected void sendWaitMessage()
protected void sendStartMessage(long start, long length)
protected void sendStopMessage(long end)
protected void sendFinishMessage(long end)
protected void sendProgressMessage(long end, int progress, int speed)
protected void handleMessage(Message msg)
protected void handleWaitMessage()
protected void handleStartMessage(long start, long length)
protected void handleFinishMessage(long end)
protected void handleStopMessage(long end)
protected void handleProgressMessage(long end, int progress, int speed)
protected void sendMessage(Message msg)
protected Message obtainMessage(int responseMessage, Object response)