I am designing an App that requires a background task to be performed (to free up the UI thread) but at points during its execution it needs to test for a users click.
Is it possible to set-up listeners in a background thread or does it need to hand control back to the UI thread?
EDIT:
I have 6 small 1 second long music files (.wav) each a different musical note. When the user runs the program, each music file will play for 1 second. After all 6 have played it will then play the same notes in a different order.
e.g (1 2 3 4 5 6) then (2 1 3 4 5 6) then (2 1 4 3 5 6 ) etc...
I would like the user to be in control of one of the notes say, the note contained in file 5, every time 5 is supposed to be played, the user clicks a button to try and play the note in time with the other notes and their music file should play and the app will carry on working through with the user pressing the button once in each set of 6 notes.