I am calling an asynctask from the main thread of my Android application. However, I need to pause the main thread till the time the async task is over. Can someone suggest how to do this?
Edit : I need to use an AsyncTask, as I can not perform network requests on the main thread
AsyncTask
? The point of anAsyncTask
is to not pause the main thread when doing some work. Also went would you want to do that? Pausing the main thread is something you should avoid.