I'm trying to design an android app but struggling with structure.
Basically from the UI action I need to run a thread to do some heavy maths work and this thread will run for a set amount of time set by variable from UI which isn't constant each time its run.
After this thread has completed and generated a result I then am thinking it will return to the ui thread and then I need to start another thread for another heavy maths work again for a set amount of time which is diff from the first thread and generate another number and then return to the UI thread.
so UI thread which has two variables Time A, and Time B button on UI thread "Start"
thread 1 starts does maths till Time A passes result of maths passed back to UI
UI then starts thread 2 but only when thread 1 is complete
Thread 2 started does maths till Time B passes result of maths passed back to UI
UI displays result of first thread and second thread
Hope this makes sense