• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps AsyncTask Android App

I am working on a android app that downloads an xml file from a web server. I am using the Async Task so I dont block the ui thread..the problem is the download progress dialog gets to 25% then goes to 0 and starts again...but the download is working correctly....not sure what the problem is....below is the code I am using

Code:
  while ((bufferLength = inputStream.read(buffer)) != -1) {
                                fileOutPut.write(buffer, 0, bufferLength);
                                //int progress = ( downloadedSize * 100) / totalSize;
                                publishProgress("" + (int) ((downloadedSize * 100 / totalSize)));
                                downloadedSize += bufferLength;
                            }

thank you for any help......
 
Back
Top Bottom