Skip to content

Commit 4faa374

Browse files
sspanakCopilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 86cd8f7 commit 4faa374

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

app/src/main/java/io/github/sspanak/tt9/util/SupremeExecutor.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,13 @@ public static void execute(@NonNull Runnable task) {
2929
get().execute(task);
3030
}
3131

32+
private static final Handler MAIN_HANDLER = new Handler(Looper.getMainLooper());
33+
3234
public static void executeOnMainThread(@NonNull Runnable task) {
3335
if (Looper.myLooper() == Looper.getMainLooper()) {
3436
task.run();
3537
} else {
36-
new Handler(Looper.getMainLooper()).post(task);
38+
MAIN_HANDLER.post(task);
3739
}
3840
}
3941
}

0 commit comments

Comments
 (0)