Tuesday, March 20, 2012

[android-developers] ListFragment alwasy shows the loading screen

Hello:

I have an example similar to the Shakespeare example with one
ListFragment showing a list of items. The second ListFragment shows a
second list based on the item the user clicks in the first fragment.
The data is taken from the Internet, so proper background threads are
used to leave the GUI thread do its thing.
The first thread loads the data OK. But when the app loads the first
time, and every time I select an item from the first list, the second
list always shows a loading icon like a indefinite ProgressBar
component. If I scroll a little, the ProgressBar goes away, but it
comes back every time I select a new item.

How do I tell Android the ListFragment has finished working on the
data ?

The second list is filled in onActivityCreate(). The ListFragment is
replaced with a new one as is done in the Shakespeare axample. A new
Thread is run in onActivityCreate() to load the list in the
background. Once the list is loaded a Handler.post() is issue to
update the actual list.

Thanks.

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate