Hello,
I am having a problem with a calendar app i am writing.  I have three
GridViews within a ViewFlipper .  Each GridView shows a month.  The
ViewFlipper responds to flings in order to flip to the next or
previous month GridView and update the unseen GridViews.  The problem
is that while the first month shows perfectly the adjacent two months
in either direction dont appear at all until the user has flinged past
them to the third month away.   So if I start in February, March wont
show until I fling to May and then back to March.  April wont show
until I fling to June and back.  However, once I fling to June all
months show correctly and the calendar works perfectly in both
directions.

It would appear to be an initialization problem but the method that
initializes the months is the same used to flip the months.  All three
months are initialized to now in the constructor and then flipped by
0, +1, & -1 using the same method that flips them on fling.   I
thought that unseen GridViews might not inflate immediately, so I
tried waiting for a few minutes before flinging and it still
happened.  I am calling onFinishInflate() everywhere things are being
inflated and they are all called predictably.

The GridView population happens in a separate thread, so I suspected
that the GridView is displayed before the thread has a chance to
finish running.  However, this theory is suspect because the problem
only happens on initialization.  After three flings the whole thing
works perfectly regardless of how fast or slow you fling it.

At this point I am at a loss.  When I tried this using TableLayouts
instead of GridViews the fling initialization worked perfectly (but
the grid was not uniform, so I cant use TableLayout).  Is there some
strange interaction between GridView and ViewSwitcher that prevents
the unseen GridViews from rendering immediately?  Any ideas?

Thanks,
Clark

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

Reply via email to