[android-developers] Re: My ProgressDialog suffers from ANR timeouts?

2010-03-20 Thread dsukhram
Thanks Paul you were correct. I increased the buffer size by 8 times and it worked. On Mar 19, 10:28 pm, Paul Turchenko paul.turche...@gmail.com wrote: Try increasing your buffer size (or better, make it content-length- dependent). It seems that UI theread reseives too much tasks to do and

[android-developers] Re: My ProgressDialog suffers from ANR timeouts?

2010-03-20 Thread Paul Turchenko
Well, but generally, it's not a solution. Try making your buffer size content-length dependent: totalSize = conn.getContentLength(); . byte data[] = new byte[totalSize/100]; This way you'll get exactly +1% update for download progress. For most generic case I would suggets somethig line

[android-developers] Re: My ProgressDialog suffers from ANR timeouts?

2010-03-20 Thread skink
On Mar 20, 2:20 pm, Paul Turchenko paul.turche...@gmail.com wrote: Well, but generally, it's not a solution. Try making your buffer size content-length dependent: totalSize = conn.getContentLength(); . byte data[] = new byte[totalSize/100]; This way you'll get exactly +1% update for

[android-developers] Re: My ProgressDialog suffers from ANR timeouts?

2010-03-19 Thread Streets Of Boston
You should show some code-snippets of how you show/dismiss your progress dialog and how the download is handled. Right now, there is not enough info to help you. On Mar 19, 2:31 pm, dsukhram duanesukh...@gmail.com wrote: I am downloading a 230MB database file from a server. I am displaying the

[android-developers] Re: My ProgressDialog suffers from ANR timeouts?

2010-03-19 Thread dsukhram
this is my inner class that handles the downloading and progressbar public class DownloadDBTask extends AsyncTaskObject, Integer, Object { private int mProgress; public Object doInBackground(Object ...urls) { //download file int totalSize =0; try { URL urlFile = new

[android-developers] Re: My ProgressDialog suffers from ANR timeouts?

2010-03-19 Thread Paul Turchenko
Try increasing your buffer size (or better, make it content-length- dependent). It seems that UI theread reseives too much tasks to do and this makes it other tasks to wait too long. This makes android show ANR message. If this not helps, try dealing with download from your own separate thread.