This commit is contained in:
imkiva
2018-03-25 00:39:46 +08:00
parent 4b5a0a6372
commit 3341084f1c

View File

@ -65,15 +65,12 @@ final class SetupThread extends Thread {
final int totalReadBytesFinal = totalReadBytes;
final int totalBytesFinal = totalBytes;
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
try {
double progressFloat = ((double) totalReadBytesFinal) / ((double) totalBytesFinal) * 100.0;
progressDialog.setProgress((int) progressFloat);
} catch (RuntimeException ignore) {
// activity dismissed
}
activity.runOnUiThread(() -> {
try {
double progressFloat = ((double) totalReadBytesFinal) / ((double) totalBytesFinal) * 100.0;
progressDialog.setProgress((int) progressFloat);
} catch (RuntimeException ignore) {
// activity dismissed
}
});