DiskShaderCacheProgress.java: Use runOnUiThread instead of a Handler.

This commit is contained in:
SachinVin 2021-04-22 20:45:27 +05:30 committed by bunnei
parent 3e171e2d65
commit 0b32c2792e

View File

@ -39,9 +39,6 @@ public class DiskShaderCacheProgress {
private static ProgressDialogFragment fragment;
public static class ProgressDialogFragment extends DialogFragment {
private final Handler updateHandler = new Handler();
ProgressBar progressBar;
TextView progressText;
AlertDialog dialog;
@ -92,7 +89,7 @@ public class DiskShaderCacheProgress {
}
private void onUpdateProgress(String msg, int progress, int max) {
updateHandler.post(()->{
Objects.requireNonNull(getActivity()).runOnUiThread(() -> {
progressBar.setProgress(progress);
progressBar.setMax(max);
progressText.setText(String.format("%d/%d", progress, max));