Don't use a delayed Runnable, just post the Runnable. That will queue it the events queue.
On Mon, Jan 12, 2009 at 5:07 PM, Al <[email protected]> wrote: > > Hi all, > in my irc app, I'm trying to improve the responsiveness when it has to > deal with a lot of data at a single time. > > At the moment, once the data is append()-ed to the textview, I post a > delayed runnable (100ms delay) back to the UI thread to make it scroll > right down to the bottom. Unfortunately, without the runnable being > posted, it doesn't seem to be possible to correctly calculate the > amount the ScrollView should scroll and often scrolls halfway only. > > This works fine for normal situations and the program is fully > responsive. But when, there is a lot of channel activity, the queue of > Runnables start to strain the UI thread and it has trouble appending > the data as it arrives and occasionally causes an ANR. > > My question is, how would I get around this? Without the Runnable, it > doesn't scroll correctly but with it, it causes problems. A possible > solution could be to detect when there is an influx of data and post > the Runnable less often, but I'm not sure how I would detect this. > > Any ideas welcomed. > > > -- Romain Guy Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

