迎接
我在MyRequestListener中使用RequestProgressListener,如下所示:
@Override
public void onRequestProgressUpdate(RequestProgress progress) {
Log.d(LOG_TAG, "Progress update: " + progress.getProgress());
}
我在日志中看到RequestProcessor会更改状态,但进度更新会不断显示0。
D//RequestProcessor.java:358(1391): 10:49:39.346 Thread-117 Sending progress PENDING
V//RequestProcessor.java:481(1391): 10:49:39.392 main Notifying 1 listeners of progress com.octo.android.robospice.request.listener.RequestProgress@41356ad0
I//MyRequestListener(1391): Progress update: 0.0
D//RequestProcessor.java:358(1391): 10:49:39.459 Thread-119 Sending progress READING_FROM_CACHE
V//RequestProcessor.java:481(1391): 10:49:39.472 main Notifying 1 listeners of progress com.octo.android.robospice.request.listener.RequestProgress@412e3a68
I//MyRequestListener(1391): Progress update: 0.0
D//RequestProcessor.java:358(1391): 10:49:39.538 Thread-119 Sending progress LOADING_FROM_NETWORK
V//RequestProcessor.java:481(1391): 10:49:39.546 main Notifying 1 listeners of progress com.octo.android.robospice.request.listener.RequestProgress@41294d88
I//MyRequestListener(1391): Progress update: 0.0
D//RequestProcessor.java:358(1391): 10:49:39.757 Thread-119 Sending progress WRITING_TO_CACHE
V//RequestProcessor.java:481(1391): 10:49:39.765 main Notifying 1 listeners of progress com.octo.android.robospice.request.listener.RequestProgress@41366160
I//MyRequestListener(1391): Progress update: 0.0
D//RequestProcessor.java:358(1391): 10:49:39.810 Thread-119 Sending progress COMPLETE
V//RequestProcessor.java:481(1391): 10:49:39.820 main Notifying 1 listeners of progress com.octo.android.robospice.request.listener.RequestProgress@413c6da0
I//MyRequestListener(1391): Progress update: 0.0
我错过了什么,或者只是它的方式?
对我来说很明显,很难衡量一些像REST请求那样不可预测的事情的进展,但它说它做到了:)
如果需要更多详情,请告知我们。
答案 0 :(得分:3)
请求进度有效。但是,使用Google Http Java Client或Spring Android的实际设计无法获得REST请求的进度。其他请求(如二进制请求)确实可以提供进度,因为我们可以完全控制下载。
很抱歉,如果RS文档中有相关内容不明确的话。您能提供误导性信息的链接,以便我们更新维基吗?