Loopj. Get progress while downloading image using BinaryHttpResponseHandler

StackOverflow https://stackoverflow.com/questions/20408253

  •  29-08-2022
  •  | 
  •  

質問

Thanks for such a wonderful library. Just wanted to know is there a way to get the progress or byte size downloaded while downloading big size images/files whith BinaryHttpResponseHandler. Awaiting response.

Hoping to get sample code for using this.

役に立ちましたか?

解決

All you have to do is override the OnProgress method :

@Override
public void onProgress(long bytesWritten, long totalSize) {
    long progressPercentage = (long)100*bytesWritten/totalSize;
}
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top