views:

24

answers:

1

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.

A: 

Im not sure I understand exactly how your program is constructed, so that the views are not shown until you start updating... but perhaps myLayout.forceLayout() helps?

sandis