Is there a way to do UI task in the doinbackground() of the AsyncTask. I am well aware it is better to do it in onPostExecute method. But in my case since I am need to use a
onPreExecute() {
// some code #1
}
doInBackground() {
runOnUiThread(new Runnable() {
public void run() {
// some code #3 (Write your code here to run in UI thread)
}
});
}
onPostExecute() {
// some code #3
}