I have created display using Fragments, both of which is being populated with data pulled from the internet. While the code itself works as expected without any issues, one of a Fragments (implemented as ListFragment) displays an indeterminant progress indicator within the fragment, which is skewed off to the side. I wish to remove the indicator and use a different ProgressDialog I implemented as the indicator instead.
Doing some research, I have discovered the function setListShownNoAnimation() (documented here) in the ListFragment class, but the following attempts didn’t work:
- Calling setListShownNoAnimation() in the fragment’s
onActivityCreated() - Calling it in the parent activity’s
onCreate - Calling it in the fragment’s
onCreateView()(this caused anIllegalStateException)
How can I remove the fragment’s progress indicator?
The right way to do this is to call:
when you need the ProgressBar to be hidden and show the ListView. Call this when you are finished getting the data in the background and are ready to show the list.