I\'ll keep this one as simple as I can.
I have a method in my control layer that uses a class CallServiceTask that extends AsyncTask. When
You can use get() to retrieve your value/object back from AsyncTask.
new CallServiceTask().execute(parameters).get();
This will return you computed result that you are returning. But this will block your UI till your background process is completed.
Another option is to create an Interface or BroadcastReceiver that you return you the value as soon as your doInBackground() is completed. I had created a demo for the same using Interface and BroadcastReceiver you can check if from my github
Also, by using second approach your UI will not be blocked!