Question: I am having a main class A, from which i create an object to class B extending Asynctask. Have set content view in A. Now in doInBackground of B, i want to update the textView of A, but its giving 

`Caused by: android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.` 

Exception. I tried declaring the setcontentview in B as well, but no use, can anyone please tell how to edit the textview of A in B??

Answer: 
override onProgressUpdate and call publishProgress in doInBackground
We should not perform any ui changes in the doinBackgroud. You should and can perform in post execute. and also you can set notification in preexecute or onProgressUpdate. 

Hope this will help you.