How to tell main
thread to execute a statement when a boolean becomes true in another thread? I was guessing wait and notify could be of use here but then i need to synchronise on something. Then i tried join method but it immediately stops my main thread and the UI stops taking any user presses on android