How to implement a progress bar while loading data into a ListView?
- I asked this question earlier. Right here is the solution. Stackoverflow.com/questions/508475/… - Android Android
- look here github.com/codepath/android_guides/wiki/… - mit
|
1 answer
First of all, add the progress bar component to the xml markup:
<ProgressBar android:id="@+id/pbData" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:visibility="gone" android:indeterminate="true"/> the value of the visibility parameter gone makes the component invisible.
Further in the code, before starting the data loading into the ListView, make the ProgressBar visible:
mPbData.setVisibility(View.VISIBLE); After the data download is complete, the ProgressBar must be made invisible again:
mPbData.setVisibility(View.GONE); |