CircularProgressIndicator shows too late, when time consuming code has finished
I am trying to show a progress indicator in some time consuming code but the screen is not refreshed while the code is running. After the code is finished it animates the indicator.
The solution is probably simple for an experienced android developer which I am not.
I created a minimum code application to show the problem