소스 검색

优化部分代码判断

Pq 1 년 전
부모
커밋
747643feed
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      BaseLibrary/src/main/java/com/cooleshow/base/utils/helper/DownloadHelper.java

+ 4 - 2
BaseLibrary/src/main/java/com/cooleshow/base/utils/helper/DownloadHelper.java

@@ -207,8 +207,10 @@ public class DownloadHelper {
                 if (task.getListener() != downloadListener) {
                     return;
                 }
-                Log.d(TAG, "paused taskId:" + task.getId() + ",soFarBytes:" + soFarBytes + ",totalBytes:" + totalBytes + ",percent:" + soFarBytes * 1.0 / totalBytes);
-                Log.d(TAG, "paused taskId:" + task.getId() + ",soFarBytes:" + soFarBytes + ",totalBytes:" + totalBytes + ",percent:" + soFarBytes * 1.0 / totalBytes);
+                if(totalBytes>0){
+                    Log.d(TAG, "paused taskId:" + task.getId() + ",soFarBytes:" + soFarBytes + ",totalBytes:" + totalBytes + ",percent:" + soFarBytes * 1.0 / totalBytes);
+                    Log.d(TAG, "paused taskId:" + task.getId() + ",soFarBytes:" + soFarBytes + ",totalBytes:" + totalBytes + ",percent:" + soFarBytes * 1.0 / totalBytes);
+                }
                 if (mEventListener != null) {
                     HashMap<String, ArrayList<String>> downloadTaskInfos = getDownloadTaskInfos();
                     Iterator<String> iterator = downloadTaskInfos.keySet().iterator();