On further looking into thread part, I managed to find that using ThreadHandler is simpler than using a thread + a looper (as a ThreadHandler has a looper attached to it by default, and manages it well). So, this is the code I am looking towards for now.
HandlerThread mThread = null;
Handler mHandler = null;
func(){
subA();
if(mThread == null){
mThread = new HandlerThread("mThread");
mThread.start();
mHandler = new Handler(mThread.getLooper());
}
mHandler.post(new Runnable(){
public void run(){
subB();
subC();
}});
}
But I find one issue with this code, I still need to create a new object of a runnable on each call to func(). Need to find out how I can avoid this.