mirror of
https://github.com/zoriya/react-native-background-downloader.git
synced 2025-12-06 06:56:10 +00:00
android: try fix ANR in onProgress method
This commit is contained in:
@@ -405,12 +405,16 @@ public class RNBackgroundDownloaderModule extends ReactContextBaseJavaModule imp
|
||||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
try {
|
||||
th.start();
|
||||
th.join();
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
new Thread(new Runnable() {
|
||||
public void run() {
|
||||
try {
|
||||
th.start();
|
||||
th.join();
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
} else {
|
||||
params.putInt("written", (int)download.getDownloaded());
|
||||
params.putInt("total", (int)download.getTotal());
|
||||
|
||||
Reference in New Issue
Block a user