I'm a newbie in android and it seems to be simple, but I have following app structure.
App has button in main activity (which became disabled after click) and two tab fragments.
Active tab fragment run approx 20 threads via model-class.
So only model-class knows when all threads finished, but using view element in model is awful decision.
How to enable button after all background threads finished?
Timeout is bad choice, because no one knows on what device code will be performed and it can takes some time. Thread.join()
or wait()
hangs ui in my case.
Appreciate for any suggestions. I can provide code if it's necessary, but question seems to be general.