Based on scanty evidence, I am leaning toward this being an event loop
clogging.

My experiment on a G1 ran for two hours and did not crash. But the UI
on the device was unresponsive to where clicks could take. The HTC
Incredible could be shutting down as a defense mechanism.

I am already trying *not* to call AsyncTask.publishProgress too
often.

Here I am checking to see that the last time was at least 10 seconds
ago.

        n.setToNow();
        // only update every four seconds or so.
        if (n.toMillis(false) - lastupdate.toMillis(false) > 6000) {
                this.publishProgress(new DownloadProgress(progress));
                lastupdate.setToNow();
        }

Context.getString(int resId, Object... formatArgs)

What happens in onProgressUpdate is not very complex, but it does
update a notification with a status bar. in the process, it calls
Context.getString(int resId, Object... formatArgs)which I believe.

I know String.format to be extremely slow in Android and even slower
in debug mode. It's bitten me before. I don't think it would take 6
second, but who knows.

Any insights are still welcome.

I'd like to find the right balance of how often to call
publishProgress(). Too often and it could freeze (or even reset). Too
seldom and the user will think it is frozen because they don't see any
progress.

Nathan

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to