I am working on a java multi-threaded application on Android.
Thread 1: Listener Thread. keep listening on a socket, fires 2nd thread for some action
Thread 2: Action Thread. short lived. get fired from first thread, do a simple action and dies.
Thread 1 does not wait on Thread 2, as it goes back to listening after firing Thread 2.
Can I execute a method in Thread1 (say thread2ActionCompleted()) from Thread2 just before it ends.
For some reason I cannot use static method or static variable in Thread 1
I saw some similar threads using ExecutorService
, but couldn't find a good example if it will work in my situation.