Suppose I have a class Main (Activity). It displays main_layout.xml . I also have a class NotMain, in which there is a stopWorking () method that does
Thread t = new Thread(new Runnable() { public void run() { TimeUnit.SECONDS.sleep(4); String output = "Test"; } }); t.start();
From the main Main class, I call this method, which after execution must somehow send the output string back to the main stream, to Main , so that it assigns it to the TextView in main_layout.xml . How can this be realized?
Ps I can not give the full code of the program, it is too confused and great for everyone to see, but I can not figure out with this part of the program