Refresh layout while filling it

Posted by neutrino on Stack Overflow See other posts from Stack Overflow or by neutrino
Published on 2010-07-08T08:00:13Z Indexed on 2011/03/19 16:10 UTC
Read the original article Hit count: 270

Hi guys,

I have an activity with a HorizontalScrollView. When it opens, I start filling this view (or rather, a container layout inside it) with another views. This is done from another thread by using handler.post.

The views are added in bunches of 15, and when there are no more views to add, I start updating them with new data (this is a kind of streaming data from a server).

The problem is that the scrollview is empty until all of the views are added. As soon as they are all added and start updating, the scrollview gets drawn.

How do I refresh it in the process of adding views? I don't want the screen to be empty for 3 seconds while all of the views are added.

Thanks a lot.

UPDATE: turned out this problem is not specific for HorizontalScrollView, this is the case for any generic layout.

© Stack Overflow or respective owner

Related posts about android

Related posts about refresh