I have a program that needs to change some view via a listener.
More precisely, I have something that listen for incoming connections, and when that happens, I need to notificate this to the user via a popup.
Now I call a static method of the main activity, an inside that i set some variables, that I read via a thread every second. Is this the best way to do that or there's something better?
I'd like something that I can use immediatly to notify events to the user, instead of using a memory-consuming thread.