This is the code I'm using
The problem is that after some time (File gets more weight) notification bar get slower to pulldown, and finally it just freezes!
This is the code I'm using
The problem is that after some time (File gets more weight) notification bar get slower to pulldown, and finally it just freezes!
This solution worked for me (ugly but working):
private static int mPercentDownloaded;
@Override
protected Void doInBackground(String... params) {
...
mPercentDownloaded = (int) ((total * 100) / lenghtOfFile);
long currentDownloadTicks = System.currentTimeMillis();
if (currentDownloadTicks > mDownloadTicks + 1000) {
publishProgress(mPercentDownloaded);
mDownloadTicks = currentDownloadTicks;
}
...
}
Your notifications are too frequent. thats why it freezes. make them update in bigger intervals. Ok is once in every second or 2 seconds.