So I have a method createDataOffer() which takes a couple of seconds to finish and I want to let the user know the system is doing something by showing a notificaion upon clicking the button.
However the notificaion appears only after the method has finnished. So how can I make the notification appear instantly? I allready tried adding two separate click listeners for the respective calls, but same result.
Button createButton = new Button("Create");
Notification startNotification = new Notification("Creating data offer", 3000);
createButton.addClickListener(evt -> {
startNotification.open();
createDataOffer(price);
});