Web から入力されたリストビューを使用したアクティビティがあります。データの読み込み中に、リストビューの代わりに進行状況ダイアログを表示したいと思います。
私のレイアウト:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ProgressBar
android:id="@+android:id/progress_large"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
<ExpandableListView
android:id="@+id/listview"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
プログレスバーがそれ自体を表示するようにこれを行います(そしてこれは機能します):
setProgressBarVisibility(true);
ただし、リストビューに(AsyncTaskを使用して)データが入力されると、進行状況バーを非表示にしたいのですが、そうではありません。リストビューの上にとどまります。
AsyncTask で行ったことは次のとおりです。
@Override
protected void onPostExecute(Void result) {
setProgressBarVisibility(false);
//... and some code to update UI
}