ericsk wrote:
> Hi,
> 
> I have a problem on TabActivity's invalidation.
> There're few tabs in my TabActivity, and each tab binds a ListView.
> Each Listview binds an ArrayAdapter that bound an ArrayList.
> 
> While the TabChanged ( in onTabChanged handler ), I modify an
> ArrayList with a thread.

There's your problem.

> However, while the thread ends and the
> ArrayList was also modified, the listview doesn't refresh its content
> even if I call getTabHost().getCurrentTabView().invalidate().
> 
> Is there any suggestion on this problem? Thanks.

Preferably, modify the ArrayAdapter using add() rather than modifying
the backing ArrayList. The ArrayList will not notify the ArrayAdapter of
any changes (because there's no way for it to do so), so the
ArrayAdapter will not realize there is new material.

You could also try calling ArrayAdapter#notifyDataSetChanged() or
notifyDataSetInvalidated(), to see if either one of those causes the
ArrayAdapter to refresh from the updated ArrayList. I have not tried
either of those, and they are undocumented, but they sound promising...

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 2.0 Available!

--~--~---------~--~----~------------~-------~--~----~
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