Android How to keep my AsyncTask from failing?

No, there's no time limit. But you should watch carefully which methods you use when you do some long-running job. AsyncTask has a method doInBackground which gets called from a worker thread and other calls are made from the UI thread.

If you're getting ANR, that means you do your job in the UI thread, which is wrong. You should do it in doInBackground method instead Check out AsyncTask documentation and Painless Threading article.

No, there's no time limit. But you should watch carefully which methods you use when you do some long-running job. AsyncTask has a method doInBackground which gets called from a worker thread and other calls are made from the UI thread.

If you're getting ANR, that means you do your job in the UI thread, which is wrong. You should do it in doInBackground method instead. Check out AsyncTask documentation and Painless Threading article.

Cody If I had to debug, I would wrap the entire doInBackground in try catch exception e and do Log. D(TAG,"doInBackground",e). Malcolm is correct that this should not result in an ANR message unless you are somehow blocking the UI thread.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions