void (RangeSearchTask caller, long lastScannedPageNumber) { if (inBackground) { ApplicationManager.getApplication().invokeLater(() -> { onSearchIsFinished(caller, lastScannedPageNumber); }); } else { onSearchIsFinished(caller, lastScannedPageNumber); } }