Skip to content

Commit

Permalink
Fix runOnMainThread to run at front of queue (#7792)
Browse files Browse the repository at this point in the history
  • Loading branch information
yogevbd authored Oct 5, 2023
1 parent b5f6c59 commit d8774bc
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ public void onWindowDetached() {

public static void runOnMainThread(Runnable runnable) {
if (Looper.myLooper() == Looper.getMainLooper()) {
new Handler(Looper.getMainLooper()).postAtFrontOfQueue(runnable);
runnable.run();
} else {
new Handler(Looper.getMainLooper()).post(runnable);
new Handler(Looper.getMainLooper()).postAtFrontOfQueue(runnable);
}
}

Expand Down

0 comments on commit d8774bc

Please sign in to comment.